Republican presidential nominee Donald Trump speaks as Democratic candidate Hillary Clinton listens during their third and final debate in Las Vegas on Oct. 19, 2016 Reuters

You (probably) learned it in history class: To win the United States presidential election, a candidate must get a majority of the electoral college votes. This year, that means either Republican Donald Trump or Democrat Hillary Clinton needs to score 270.

But what if they don't? After all, it is possible, what with the recent rise of third-party candidates like Libertarian Gary Johnson and Independent Evan McMullin putting states like New Mexico and Utah into play. Would the world end? Would we be caught in a perpetual election cycle, with weekly GOP debates, daily email hacks and constant news conferences where nobody ever answers any questions?

Well, no. Here's what would happen.

The House of Representatives would choose the president from the three candidates who got the most electoral votes, according to the National Archives and Records Administration's frequently asked questions page. The representatives would have one vote, "and a majority of all the states shall be necessary to a choice," according to the 12th Amendment.

Before Election Day, the Republican party controlled the House, so it would likely choose Trump as president. There are a number of congressional races that will be decided Tuesday, but even if House races in certain states go Democratic, the Republican party will still probably have the numbers to control the House.

But, as Time explained, there is a scenario in which some GOP candidates from swing states might feel guilted into supporting Clinton if the majority of their voters back her in the presidential contest. If that happens, it's possible the House election could end in a tie.

In either case, the drama would then move to the Senate, which is tasked with selecting the vice president from the two veep candidates with the most electoral votes. That would probably mean a contest between Clinton running mate Tim Kaine and Indiana Gov. Mike Pence from the GOP ticket.

After Election Day, the Senate will likely be under the control of the Democrats, NPR reported. Assuming the Democratic and Republican tickets have the most votes and that people vote along party lines, the Senate would probably name Kaine to be vice president.

In the event of a tie in the House, he would serve as president until the House resolved its disagreements — a period that could hypothetically stretch until the next inauguration, set for Jan. 20, 2021, according to Politico.