Example. B, an alien individual who is a citizen of foreign country M, comes to the United States for the first time on May 1, 1985, and remains in the United States until November 5, 1985, when he returns to country M. B comes back to the United States on March 5, 1986 as a lawful permanent resident and remains in the United States until September 10, 1986, when he ceases to be a lawful permanent resident and returns to country M. B is not a resident in calendar year 1987. B's United States residency in calendar year 1985 continues through December 31, 1985, because he is a United States resident in the following calendar year. In calendar year 1986, B's United States residency is deemed to begin on January 1, 1986 because B qualified as a resident in the preceding calendar year. Thus, B's residency period in the United States begins on May 1, 1985, and ends on September 10, 1986.
26 C.F.R. §301.7701(b)-4