https://www.history.com/news/can-the-president-and-vice-president-be-from-the-same-state
There are many misconceptions about the rules of a president choosing their running mate. There’s no law or regulation against a president and vice president of the United States being from the same state. The reason why some people mistakenly believe such a prohibition exists comes down to a particular aspect of the Electoral College system laid out in Article II of the U.S. Constitution.
Article II states: “The electors shall meet in their respective states, and vote by ballot for two persons, of whom one at least shall not be an inhabitant of the same state with themselves.”
Under the original system, electors did not distinguish between candidates for the nation’s top two offices; the candidate with the most votes became president, while the runner-up became vice president. The 12th Amendment, adopted in 1804 after two chaotic elections, mandated that electors cast separate ballots for president and vice president. However, the rule preventing an elector from voting for two people from his home state remained in effect under the new system.
In most elections, this quirk in the system wouldn’t even matter. In 2008, Barack Obama could have chosen a running mate from his home state of Illinois in either 2008 or 2012 with no adverse effect; the same goes for Ronald Reagan in 1980 or ’84, George H.W. Bush in 1988 and Bill Clinton in 1992 or ‘96.
But if an election turns out to be particularly close, the rule could potentially come into play. It almost did in the notoriously contentious election of 2000. When Texas Gov. George W. Bush chose Dick Cheney as his running mate on the Republican ticket, Cheney had been living and voting and paying taxes for five years in Texas. Shortly before the election, however, Cheney obtained a Wyoming driver’s license and put his Dallas home on the market. (He had a vacation home in Wyoming, which is the state he had formerly represented in the U.S. Congress.) Good thing for him he did: The Bush-Cheney ticket ended up winning with 271 electoral votes—just a slim five-vote margin—over Al Gore and Joe Lieberman, a total they certainly wouldn’t have hit without Texas’ 32 votes.