Answer :

The House of Representatives. 

In this election, Thomas Jefferson was running against John Adams. However, under the Constitution back then, each member of the Electoral College cast two votes for president. Supporters of the two main political parties - the Federalists and the Democratic-Republican party - who were in the Electoral College would cast their votes for their party's presidential candidate and his running mate.

Thomas Jefferson and running mate Aaron Burr (of the Democratic-Republicans party) won the most electoral votes, but ended up tied. The D-Rs had planned to have one elector not vote for Burr (and just vote for Jefferson) so that Jefferson would win by one, but this didn't happen and instead they tied for president.

Thus, the election went to the House of Representatives, who are in charge of deciding a presidential election if it is tied after the Electoral College vote. After multiple rounds of voting, they elected Jefferson over Burr.

After the election, the Constitution was amended (12th amendment) so that this would never happen again.