The Uniformed and Overseas Citizens Absentee Voting Act (UOCAVA) accords the right to vote in Federal elections (President, Vice President, U.S. Senator, U.S. Representative, or non-voting delegate from DC, PR, GU, etc.) to citizens of the United States who have LEFT the "United States" and moved (temporarily or permanently) to a place that is NOT in the United States.
UOCAVA defines several terms, including the term "United States." That term, when used in a geographical sense, means the 50 states, the District of Columbia, the Commonwealth of Puerto Rico, the United States Virgin Islands, Guam, and American Samoa. The Northern Mariana Islands have also been added to territories covered under UOCAVA.
For example, let’s say that Joe Smith, a civilian and citizen of the United States, moves from the state of New York to the Commonwealth of Puerto Rico. Is Joe Smith eligible to vote in New York by absentee ballot under UOCAVA? The answer is NO. Joe Smith has NOT technically left the United States. For UOCAVA purposes, Puerto Rico is just as much part of the United States as New York is, and so Joe will vote as a resident of Puerto Rico.