Here are the four elections when the candidate who led the popular vote did not win the office:
1824: John Quincy Adams received more than 38,000 fewer votes than Andrew Jackson, but neither candidate won a majority of the Electoral College. Adams was awarded the presidency when the election was thrown to the House of Representatives.
1876: Nearly unanimous support from small states gave Rutherford B. Hayes a one-vote margin in the Electoral College, despite the fact that he lost the popular vote to Samuel J. Tilden by 264,000 votes. Hayes carried five out of the six smallest states (excluding Delaware). These five states plus Colorado gave Hayes 22 electoral votes with only 109,000 popular votes. At the time, Colorado had been just been admitted to the Union and decided to appoint electors instead of holding elections. So, Hayes won Colorado's three electoral votes with zero popular votes. It was the only time in U.S. history that small state support has decided an election.
1888: Benjamin Harrison lost the popular vote by 95,713 votes to Grover Cleveland, but won the electoral vote by 65. In this instance, some say the Electoral College worked the way it is designed to work by preventing a candidate from winning an election based on support from one region of the country. The South overwhelmingly supported Cleveland, and he won by more than 425,000 votes in six southern states. However, in the rest of the country he lost by more than 300,000 votes.
2000: Al Gore had over half a million votes more than George W. Bush, with 50,992,335 votes to Bush's 50,455,156. But after recount controversy in Florida and a U.S. Supreme Court ruling, Bush was awarded the state by 537 popular votes. Like most states, Florida has a "winner takes all" rule. This means that the candidate who wins the state by popular vote also gets all of the state's electoral votes. Bush became president with 271 electoral votes.