Section references are to the U.S. Internal Revenue Code, unless otherwise specified.
Future Developments
For the latest information about developments related to Form 8840 and its instructions, such as legislation enacted after they were published, go to www.irs.gov/Form8840.
General Instructions
Purpose of Form
Use Form 8840 to claim the closer connection to a foreign country(ies) exception to the substantial presence test. The exception is described later and in Regulations section 301.7701(b)-2.
Note: You are not eligible for the closer connection exception if any of the following apply.
•You were present in the United States 183 days or more in calendar year 2021.
•You are a lawful permanent resident of the United States (that is, you are a green card holder).
•You have applied for, or taken other affirmative steps to apply for, a green card; or have an application pending to change your status to that of a lawful permanent resident of the United States.
Steps to change your status to that of a permanent resident include, but are not limited to, the filing of the following forms.
•Form I-508, Waiver of Rights, Privileges, Exemptions and Immunities.
•Form I-485, Application to Register Permanent Residence or Adjust Status.
•Form I-130, Petition for Alien Relative, on your behalf.
•Form I-140, Immigrant Petition for Alien Worker, on your behalf.
•Form ETA-750, Application for Alien Employment Certification, on your behalf.
•Form DS-230, Application for Immigrant Visa and Alien Registration.
Note: These forms are available at www.uscis.gov/forms/all-forms.
Even if you are not eligible for the closer connection exception, you may qualify for nonresident status by reason of a treaty. See the instructions for line 6 for more details.
Who Must File
If you are an alien individual and you meet the closer connection exception to the substantial presence test, you must
file Form 8840 with the IRS to establish your claim that you are a nonresident of the United States by reason of that exception. Each alien individual must file a separate Form 8840 to claim the closer connection exception.
For more details on the substantial presence test and the closer connection exception, see Pub. 519.
Note: You can download forms and publications at www.irs.gov.
Substantial Presence Test
You are considered a U.S. resident if you meet the substantial presence test for 2021. You meet this test if you were physically present in the United States for at least:
•31 days during 2021; and
•183 days during the period 2021, 2020, and 2019, counting all the days of physical presence in 2021 but only 1/3 the number of days of presence in 2020 and only 1/6 the number of days in 2019.
Days of presence in the United States.
Generally, you are treated as being present in the United States on any day that you are physically present in the country at any time during the day.
However, you do not count the following days of presence in the United States for purposes of the substantial presence test.
1.Days you regularly commuted to work in the United States from a residence in Canada or Mexico.
2.Days you were in the United States for less than 24 hours when you were traveling between two places outside the United States.
3.Days you were temporarily in the United States as a regular crew member of a foreign vessel engaged in transportation between the United States and a foreign country or a possession of the United States unless you otherwise engaged in trade or business on such a day.
4.Days you were unable to leave the United States because of a medical condition or medical problem that arose while you were in the United States.
5.Days you were an exempt individual.
In general, an exempt individual is
(a)a foreign government-related individual, (b) a teacher or trainee, (c) a student, or (d) a professional athlete competing in a charitable sports event. For more details, see Pub. 519.
Note: If you qualify to exclude days of presence in the United States because you were an exempt individual (other than a foreign government-related individual) or because of a medical condition or medical problem (see item 4 above), you must file Form 8843.
Closer Connection
Exception
Even though you would otherwise meet the substantial presence test, you will not be treated as a U.S. resident for
2021 if:
•You were present in the United States for fewer than 183 days during 2021;
•You establish that, during 2021, you had a tax home in a foreign country; and
•You establish that, during 2021, you had a closer connection to one foreign country in which you had a tax home than to the United States, unless you had a closer connection to two foreign countries.
Closer Connection to Two Foreign Countries
You can demonstrate that you have a closer connection to two foreign countries (but not more than two) if all five of the following apply.
1.You maintained a tax home as of January 1, 2021, in one foreign country.
2.You changed your tax home during 2021 to a second foreign country.
3.You continued to maintain your tax home in the second foreign country for the rest of 2021.
4.You had a closer connection to each foreign country than to the United States for the period during which you maintained a tax home in that foreign country.
5.You are subject to tax as a resident under the tax laws of either foreign country for all of 2021 or subject to tax as a resident in both foreign countries for the period during which you maintained a tax home in each foreign country.
Tax Home
Your tax home is the general area of your main place of business, employment, or post of duty, regardless of where you maintain your family home. Your tax home is the place where you permanently or indefinitely work as an employee or a self-employed individual. If you do not have a regular or main place of business because of the nature of your work, then your tax home is the