Gain or loss from the sale or exchange of personal property generally has its source in the United States if the alien has a tax home in the United States. The key factor in determining if an individual is a U.S. resident for purposes of the sourcing of capital gains is whether the alien’s “tax home” has shifted to the United States. If an alien does not have a tax home in the United States, then the alien’s U.S. source capital gains would be treated as foreign-source and thus nontaxable.
In general, under the “tax home” rules, a person who is away (or who intends to be away) from his tax home for longer than 1 year has shifted tax homes to his new location upon his arrival in that new location. See Chapter 1 of Publication 463, Travel, Entertainment, Gift, and Car Expenses.