If you are not a US citizen and you spend meaningful time in the United States, one determination controls almost everything else on your return: whether you are a resident alien or a nonresident alien. The substantial presence test is the day-counting rule that makes that call, and it routinely catches people certain they "were not here that much." The count is weighted across three years, which is why four months a year can make someone a full US tax resident.
Why Does US Tax Residency Status Matter More Than Anything Else on Your Return?
Because residency decides the size of the tax base, not just the rate. A resident alien is taxed on worldwide income, the same as a US citizen, and files Form 1040. A nonresident alien is taxed only on US-source income and income effectively connected with a US trade or business, and files Form 1040-NR.
That gap is enormous for anyone with foreign salary, a foreign business, foreign rental property, or a foreign portfolio. Residency also switches on the entire information-reporting regime: FBAR (FinCEN Form 114), Form 8938, Form 5471, and Form 3520. Someone who assumed nonresident status and later finds they met the test usually has both unreported income and years of missed information returns. Nothing in the test asks whether you intended to immigrate, so someone fully lawful on a visitor or work visa can still be a US tax resident.
What Are the Two Tests for US Tax Residency?
There are two residency tests, and meeting either one makes you a resident alien for the year. IRC §7701(b) sets both. Tests are not the only route to resident status: the first-year choice under §7701(b)(4) and the spousal elections under §6013(g) or §6013(h) can each produce resident status for someone who fails both tests.
-
The green card test. You are a resident if you are a lawful permanent resident at any time during the calendar year. This is about the status, not time spent here: a green card holder who lives abroad full time and sets foot in the US zero days is still a US tax resident until the card is formally surrendered or revoked.
-
The substantial presence test. A day-count test applied to everyone else, including people on B, E, H, L, O, and TN visas.
If neither test is met, you are a nonresident alien and file Form 1040-NR.
How Is the Substantial Presence Test Actually Calculated?
You meet the substantial presence test if you satisfy both of these conditions:
- You were physically present in the United States on at least 31 days during the current calendar year, and
- You were present on at least 183 days over the three-year period ending with the current year, counting:
- all days of presence in the current year, plus
- 1/3 of the days in the first preceding year, plus
- 1/6 of the days in the second preceding year.
Fewer than 31 current-year days means you cannot meet the test no matter how much time you spent here in the prior two years. Any part of a day physically present generally counts as a full day.
The 183 is a weighted total, not actual presence, so a level travel pattern crosses the line well below 183 real days per year. At an identical 122 days per year you reach exactly 183 weighted days; at a steady 121 you stay under, at 181.5. That is four months a year, not six.
Worked Example: Does Four Months a Year in the US Make You a Resident?
Take a non-citizen executive splitting time between a foreign home and US operations:
- 2024: 180 days
- 2025: 150 days
- 2026: 130 days
She was never here for half of any single year, and her presence is declining. Run the 2026 test:
- Current year (2026): 130 x 1 = 130.00
- First preceding year (2025): 150 x 1/3 = 50.00
- Second preceding year (2024): 180 x 1/6 = 30.00
- Weighted total: 210.00 days
She has more than 31 days in 2026 and more than 183 weighted days, so she meets the substantial presence test for 2026 and is taxable on worldwide income unless an exception applies. Her foreign salary, foreign brokerage gains, and foreign rental income all become reportable, and her foreign accounts become FBAR and Form 8938 items.
Notice what drives the result: the two prior years supply 80 of her 210 weighted days. A single heavy year casts a shadow forward, which is why this is a planning matter handled before December 31, not one a preparer can solve in April.
Which Days Do Not Count as Days of Presence?
Several categories of physical presence are disregarded entirely, and removing them can drop a person below the threshold.
Days Excluded From the Substantial Presence Test
Reference- Days as an exempt individual. This is a term of art and does not mean tax-exempt. It covers foreign-government-related individuals (including certain A and G visa holders), teachers and trainees on J or Q visas, students on F, J, M, or Q visas, and professional athletes competing in a charitable sporting event.
- Days commuting from Canada or Mexico. Publication 519 treats commuting to US work from a residence in Canada or Mexico as regular only if you commute on more than 75% of the workdays during your working period.
- Days in transit under 24 hours, while traveling between two points outside the United States.
- Days as a crew member. You must be a regular crew member of a foreign vessel engaged in transportation between the United States and a foreign country, and the exception does not apply on any day you otherwise engage in a US trade or business.
- Days you were unable to leave because of a medical condition that arose while you were present in the United States. This presupposes you intended to leave, and it does not apply if you were able to leave and stayed beyond a reasonable period, if you returned for treatment of a condition that arose during a prior stay, or if the condition existed before you arrived and you knew about it.
The exempt-individual categories are time-limited, which is where most errors happen. A student on an F, J, M, or Q visa generally stops being exempt after being exempt in any part of more than 5 calendar years. A teacher or trainee on a J or Q visa is generally not exempt if they were exempt as a teacher, trainee, or student for any part of 2 of the 6 preceding calendar years. Once the period runs out every subsequent day counts, so a long-term student often becomes a resident alien mid-degree with no change in visa or behavior.
Both limits have a continuation exception that is routinely missed. A student can stay exempt beyond 5 years by establishing no intent to reside permanently in the United States plus substantial compliance with their visa requirements. A teacher or trainee who fails the 2-of-6 test is still exempt if a foreign employer paid all of their compensation in the current year and in each prior teacher or trainee year within the preceding 6 years. A J-1 researcher paid entirely by an overseas institution can therefore stay a nonresident well past year two.
Anyone excluding days as an exempt individual, or for a medical condition, must file Form 8843, either with the return or mailed on its own if there is no filing requirement. Skipping it is a common and avoidable defect in a nonresident filing position.
What Is the Closer Connection Exception, and Who Actually Qualifies?
The closer connection exception lets someone who meets the substantial presence test still be treated as a nonresident alien for the year. It is claimed on Form 8840, Closer Connection Exception Statement for Aliens. You must:
- Have been present in the United States less than 183 days during the current year,
- Have maintained a foreign tax home during the entire year,
- Have a closer connection to that foreign country than to the United States, and
- Have not taken steps toward, and not have had an application pending for, lawful permanent resident status.
Condition 1 is the one people misread. That 183 counts actual current-year days, not the weighted figure. The executive above had 130 actual days in 2026, so she is eligible to try for the exception even though her weighted total was 210. Someone with 200 actual days is out, however strong their foreign ties.
Condition 2 does not force you into a single country. The IRS permits a closer connection to two foreign countries where your tax home moved from one to the other mid-year, provided you had a closer connection to each during the period your tax home was there. A mid-year relocator is not automatically disqualified.
Condition 4 catches people mid-immigration: filing or having pending an adjustment of status such as Form I-485, or having an employer file on your behalf, disqualifies you for the year.
The "closer connection" itself is a facts-and-circumstances comparison: where your permanent home is, where your family lives, where you bank, where you are licensed to drive, where you vote, and which country you list as your residence on official forms. Form 8840 asks these directly and must be filed on time.
Can a Tax Treaty Override the Substantial Presence Test?
Yes, through a mechanism separate from the closer connection exception. Most US income tax treaties contain a residency tie-breaker article for cases where both countries would otherwise treat you as a resident, running an ordered sequence of factors: permanent home available to you, then center of vital interests, then habitual abode, then citizenship, and finally agreement between the two competent authorities.
If the tie-breaker assigns you to the treaty partner, you are treated as a nonresident alien for US income tax purposes even though you met the substantial presence test. You claim it on a nonresident return disclosing the treaty-based position on Form 8833. That disclosure is not optional paperwork: the IRC §6712 penalty for failing to disclose a treaty-based position is $1,000 per failure for an individual and $10,000 for a C corporation.
Three limits matter. First, relief exists only where the United States has an income tax treaty in force with that country.
Second, the tie-breaker does not switch information reporting off wholesale, and the pieces sit on different footing. Form 8938 does come off. Its instructions carve out dual resident taxpayers directly: someone who determines their income tax liability as a nonresident under Regulations §301.7701(b)-7 is not required to report specified foreign financial assets on Form 8938 for the part of the year covered by Form 1040-NR, provided they comply with §301.7701(b)-7(b) and (c), including timely filing that Form 1040-NR with Form 8833 attached. The filings that establish the treaty position are the same ones that waive the form. The foreign entity returns do not. Forms 5471, 3520, and 8865 are generally still due, with penalties per form per year regardless of whether tax was owed. FBAR is contested. The IRS position is that FBAR survives the tie-breaker because FinCEN defines a US person independently of the treaty, but at least one district court disagreed in Aroeste v. United States (S.D. Cal.). Since FBAR penalties dwarf the cost of a filing, the conservative course is a protective FBAR.
Third, and most dangerous, a long-term resident who claims treaty nonresident status triggers the exit tax. Under IRC §7701(b)(6), a green card holder who held the card in 8 of the last 15 tax years and then takes a tie-breaker position is treated as having ceased to be a lawful permanent resident, pulling them into the §877A expatriation regime with its mark-to-market deemed sale and a Form 8854 filing. Never take a tie-breaker for a long-term resident without pricing the exit tax first.
What Happens in the Year You Arrive in or Leave the United States?
Residency usually starts and ends mid-year. Under IRC §7701(b), if you meet the substantial presence test, your residency starting date is generally the first day you were present in the United States that calendar year. A de minimis rule lets you disregard up to 10 days in setting either the starting or the ending date, if during those days you had a tax home in, and a closer connection to, a foreign country.
If you arrive too late in the year to meet the test, the first-year choice under IRC §7701(b)(4) can start residency early by election. It requires at least 31 consecutive days of presence in the current year, presence on at least 75% of the days from the first day of that period through December 31 (up to 5 days of absence disregarded), that you were not a US resident in the immediately preceding calendar year, and that you meet the substantial presence test the following year. The starting date under the choice is the first day of the 31-day period.
Your residency ending date is generally December 31 of the year you leave. It can be your actual last day of presence instead, but only if for the rest of that year you maintain a foreign tax home and a closer connection to it than to the United States. The framework is also gated on a condition people skip: under Reg. §301.7701(b)-4(b) you must not be a US resident at any time during the following calendar year. Someone who leaves in March and comes back next year gets no termination date at all. Green card holders are on a different track: residency continues until the status is formally abandoned or revoked.
A split period creates a dual-status year, with different rules for each part. Dual-status filers generally cannot claim the standard deduction and generally cannot file jointly, so married taxpayers in an arrival year compare the dual-status result against a full-year resident election with a nonresident spouse under IRC §6013(g) or §6013(h), which often wins. Mechanics are in our guide to the dual-status alien tax return.
Bottom Line
Run the weighted calculation before December 31, while the day count is still something you control. If it comes out over the line the exits are narrow: closer connection requires under 183 actual current-year days and no green card application, and a treaty tie-breaker requires a treaty in force plus a Form 8833 disclosure, which waives Form 8938 but leaves the foreign entity returns due, the FBAR contested, and a long-term resident exposed to the exit tax.
Have questions about the substantial presence test or your US tax residency status? Contact TS CPA for a free consultation. We respond within the same day.