The election of the President and the Vice President is established in Article 2 of the Constitution. The procedure is further honed by a number of federal and state laws concerning the operation of the election, especially in terms of the means of casting ballots, and how those ballots are counted. The system has fundamentally changed only somewhat since its original creation with Article 2 of the Constitution, though of course, the specific nature of each election has changed greatly as technology advanced.
To elect the President and the Vice President, the system employs the electoral college. The electors in the electoral college cast votes directly for the President and the Vice President. Whichever candidate receives an absolute majority of votes, meaning over half of all the possible votes of the electors, wins the election.
The electors are, themselves, elected by each state. The exact method for electing electors is determined by each state legislature, and not by the federal government. This means that the popular election for President and Vice President on Election Day is not actually an election directly for the President or the Vice President. The number of electors that each state may appoint is determined by adding the number of Senators that the state has to the number of Representatives of the state. No one holding a public office, such as a Senator or a Representative, can be an elector.
The electoral college system has changed somewhat as a result of the Twelfth Amendment, which adjusts the methods by which a President and Vice President are elected, specifically. In the original form of the Constitution, the Vice President would be the Presidential candidate who received the second most number of votes.
Furthermore, this meant that electors were only voting for President, and never for President and Vice President, separately. This led to a somewhat dysfunctional system, as Vice Presidents and Presidents might be at odds with each other, and there was the potential for a supposed Vice Presidential candidate to be elected President. Thus, the Twelfth Amendment altered the system, such that each elector casts one vote for President, and one vote for Vice President.
If the electoral college votes in such a way that no candidate receives an absolute majority of the votes, then the vote would go to the House of Representatives, which would hold its own vote for the President. This was part of the reason for the original implementation of the Twelfth Amendment, as the House vote resulted in an entirely different candidate winning than either the popular vote or electoral vote would have indicated in the election of 1800.
To run for President, a candidate must have been a natural born citizen of the United States, and must still be a citizen at the time he or she is running. Furthermore, the candidate must be thirty five years old at least, and must have been a resident in the United States for fourteen years. The same criteria apply to the Vice-President.