In both 1800 and 1824 no candidate got a majority in the Electoral College. So what happens in the unlikely circumstance this occurs?
The 12th amendment says:
The person having the greatest Number of votes for President, shall be the President, if such number be a majority of the whole number of Electors appointed; and if no person have such majority, then from the persons having the highest numbers not exceeding three on the list of those voted for as President, the House of Representatives shall choose immediately, by ballot, the President. But in choosing the President, the votes shall be taken by states, the representation from each state having one vote; a quorum for this purpose shall consist of a member or members from two-thirds of the states, and a majority of all the states shall be necessary to a choice.
In 1800 the House of Representatives took 36 ballots to elect Thomas Jefferson over Aaron Burr. In 1824 it took just one ballot to elect John Quincy Adams over Andrew Jackson.
The Electoral College votes are tallied on the 6th of January, and if no majority is found the House would start voting immediately. The new House takes office on 3 January so we don’t know who would be in control. But the Republicans control 33 of the 50 state delegations so unlikely not to be them.
Now what if none of the three candidates can get 26 states voting for them in the House?
And if the House of Representatives shall not choose a President whenever the right of choice shall devolve upon them, before the fourth day of March next following, then the Vice-President shall act as President
But who elects the Vice-President if a tie in the Electoral College?
The person having the greatest number of votes as Vice-President, shall be the Vice-President, if such number be a majority of the whole number of Electors appointed, and if no person have a majority, then from the two highest numbers on the list, the Senate shall choose the Vice-President; a quorum for the purpose shall consist of two-thirds of the whole number of Senators, and a majority of the whole number shall be necessary to a choice.
This has happened once in 1836.
So the new Senate would elect the Vice-President. And on 20 January the Vice-President would become the Acting President if the House had not elected a President.
What if there was a deadlock in both the House and the Senate?
Federal law provides for the Speaker of the House to become the Acting President if there is no President-Elect or Vice President-Elect. So there will be a President, one way or another.