Example 1. B, an alien individual, is present in the United States for 122 days in the current year. He was present in the United States for 122 days in the first preceding calendar year and for 122 days in the second preceding calendar year. In determining his status for the current year, B counts all 122 days in the United States in the current year plus 1/3 of the 122 days in the United States in the first preceding calendar year (402/3 days) and 1/6 of the 122 days in the United States during the second preceding calendar year (201/3 days). The total of 122 + 402/3 + 201/3 equals 183 days. B meets the substantial presence test and is a resident alien for the current year.
Example 2. C, an alien individual, is present in the United States for 25 days during the current year. She was present in the United States for 365 days during the first preceding year and 365 days during the second preceding year. The substantial presence test does not apply because C is present in the United States for fewer than 31 days during the current year.
Example 3. D, an alien individual, is present in the United States for 170 days during the current year. He was present in the United States for 30 days during the first preceding year and 30 days during the second preceding year. In determining his status for the current year, D counts all 170 days in the United States in the current year plus 1/3 of the 30 days in the United States in the first preceding calendar year (10 days) and 1/6 of the 30 days in the United States during the second preceding calendar year (5 days). The total of 170 + 10 + 5 equals 185 days. D meets the substantial presence test and is a resident alien for the current year notwithstanding the fact that he was present in the United States for fewer than 31 days in each of the two preceding years.
26 C.F.R. §301.7701(b)-1