For the benefit of those readers who do not live in the US and may be a little unclear about how the president is actually chosen, this post outlines the main details. The president is formally elected by something called the Electoral College, a largely virtual institution that exists just for the purpose of electing the president every four years. Each of the 50 states plus the District of Columbia is allocated a certain number of what are called ‘electoral votes’ equal to the sum of the Senators and members of the House of Representatives that the state sends to Congress. You need to win a majority of those votes to be elected president.
The number of senators is fixed at two for each state giving a total of 100. The total number of House members is fixed at 435 but the number each state gets is proportional to the size of its population and can change based on the census that is taken every ten years, with the last one being in 2010. Since the minimum number of House members is one, the minimum number of electoral votes a state can have is three. The largest number comes from California with 55 votes.
Although the District of Columbia has no congressional representation and thus no senators (though it has one non-voting House member), the 23rd Amendment to the Constitution passed in 1961 assigned the district as many electoral votes as it would have if it were a state, but no more than the least populous state. Hence it has three electoral votes. The total number of votes is thus 538 and this means that a candidate needs 270 votes to be elected president.
Each state gets to decide how to assign its share of electoral votes. Almost all of them assign all their votes to the winner of the popular vote in that state. The exceptions are Maine and Nebraska that in 1972 and 1996 respectively chose to go a different route. In those two states, the overall winner gets two votes but the remaining votes are allocated according to the winner in each congressional district. The overall winner in either state is thus guaranteed at least three votes. In practice, the two states have always awarded all their votes to one candidate except in 2008 when Nebraska split 4-1 in favor of John McCain over Barack Obama. In the current election, Maine looks like it may split 3-1 in favor of Hillary Clinton.
In recent history, most states are so reliably Democratic or Republican that only the local races in those states get any attention. Since Donald Trump is behind in the polls right now, it is easier to look at his possible path to victory. The Guardian has published a useful map for those seeking to follow the election more closely, especially on election night, and it shows the states he needs to win to get the absolute minimum of 270 votes for victory, assuming Maine has a 3-1 split against him.
Only a small number of states, referred to as swing or battleground or toss-up states, play a crucial role in deciding the presidential outcome and those are the ones where campaigns spend most of their time and money and the media covers. Currently the states that are considered toss-ups (in that the polls are close enough to go either way) consist of Florida, Ohio, North Carolina, Nevada, Minnesota, Indiana, Iowa, and Arizona for a total of 106 votes. (Some add the 72 votes from Colorado, Michigan, New Hampshire, Pennsylvania, Virginia and Wisconsin to the list of battleground states though current polls show all these states leaning towards Clinton.) According to the map, we see that in getting to his 270, Trump can only afford to lose one of the toss-ups (Minnesota) but has to win all the rest.
But it gets worse for him. The Guardian map has assigned New Hampshire to Trump but current polls indicate that it is actually leaning towards Clinton, so if he does lose that state, he needs to pick at least four votes somewhere else in addition to winning all of the toss-ups minus Minnesota. New Mexico may be his best shot.