Article II, section 1, clause 5 of the U.S. constitution prohibits anyone who has not been a resident of the U.S. for at least 14 years from being elected President. Herbert Hoover resided in London during and after WWI, while he was directing humanitarian relief efforts. He became President about 10 years later. Why wasn’t he disqualified from the 1928 election? Was this issue ever addressed during the 1928 campaign?
Herbert Hoover was 54 years old when he became President. He was a natural born U.S. citizen who spent the first 21 years or so of his life in the U.S., and most of his adult life abroad. But his childhood years counted toward the "14."
As pointed out by another poster, the Constitutional requirement is for "fourteen Years a Resident within the United States." That means 14 total years, not 14 consecutive years or 14 years immediately prior to becoming President.
A web site discusses this issue:
No Person except a natural born Citizen, or a Citizen of the United States, at the time of the Adoption of this Constitution, shall be eligible to the Office of President; neither shall any Person be eligible to that Office who shall not have attained to the Age of thirty five Years, and been fourteen Years a Resident within the United States.
ARTICLE II, SECTION 1, CLAUSE 5
The residency issue is explained (emphasis mine):
James Madison contended that "both [terms] were vague, but the latter [‘Inhabitant'] least so in common acceptation, and would not exclude persons absent occasionally for a considerable time on public or private business." Then as now, inhabitant meant being a legal domiciliary, but resident could mean either a domiciliary or a physical presence.
So being a resident does not end when you are temporarily out of the country. As @PieterGeerkens pointed out, it does not require uninterrupted residency.