The green card test is pretty black and white. Did the Immigration and Naturalization Service award you lawful permanent residency and give you a green card? If so, you pass the test.   The substantial presence test is actually two separate tests. You must be present in the U.S. for at least 31 days during the current year and 183 days during the past three years. However, you have to count your days in the following way:

All the days in the current yearOne-third of the days in the previous yearOne-sixth of the days two years ago

So, if you lived in the U.S. for 65 days this year, 240 days last year (only 80 count), and 240 days two years ago (only 40 count), you’d pass the residency test.

Exceptions to the Substantial Presence Test

The IRS indicates that you might still be considered a nonresident under some circumstances even if you pass the substantial presence test. Four separate circumstances must exist for this to happen:

You were present in the U.S. for less than 183 days during the year. You had a closer connection to at least one foreign country in which you maintain a tax home. You maintained a tax home in that other country for the entire year and were subject to taxation there. You have not applied for or taken any steps to acquire a green card.

Dual Status

You can elect to be treated as a U.S. resident for part of the year and be taxed as a “dual-status alien” instead of a nonresident under some circumstances. Doing so presents tax advantages, but the requirements for this unique status are a bit complex. To qualify for dual status, you must meet the following requirements:

You didn’t pass either the green card test or the substantial presence test in the current or prior year.You didn’t elect to be treated as a U.S. resident for any part of the previous year.You meet the substantial presence test in the following year to qualify.

You must also be present in the U.S. for a minimum of 31 days in a row in the current year, and for at least 75% of the days that follow the first day of that 31-day period in the current year. Dual status could be helpful if you move to the U.S. and plan on living here at least for the next two years. You must attach a statement to your Form 1040 tax return to make this election, explaining the details.

Examples of a Nonresident for Tax Purposes

The IRS considers you a nonresident if you have income from U.S. sources and don’t pass either the green card or substantial presence test. As such, you’re subject to unique reporting, filing, and withholding requirements. For example, let’s say you worked in the U.S. last year and it’s time to file taxes. If you don’t have a green card and you don’t meet the substantial presence test, then you’ll file taxes as a nonresident.

Tax Requirements for Nonresidents

Nonresidents must file Form 1040-NR (have dependents) or Form 1040NR-EZ (no dependents). A nonresident must file a U.S. tax return if they engaged in or were “considered to be engaged” in a U.S. trade or business at any time during the tax year. This includes students, teachers, and trainees who are in the U.S. on F, J, M, or Q visas. You would also have to file a tax return if you were not engaged or considered to be engaged in a trade or business, but you had income from a U.S. source for which you didn’t pay enough taxes, Your income is taxed at the same progressive rates that apply to U.S. citizen taxpayers if it’s “effectively connected” with a trade or business in the U.S. This would be the case if you worked as an independent contractor or otherwise ran your own business, or if you worked for an employer. Your income is taxed at a flat 30% if it’s fixed, determinable, annual, or periodical (FDAP) and it derives from investments, dividends, royalties, or rents. The 30% rate applies whether you earn $10 or $100,000; you don’t get a lower rate if you have less income. However, you may get a lower rate if your home country has a tax treaty with the U.S.

Types of Nonresidents

There are several types of nonresidents at the federal and state levels.

Departing Nonresident

If you leave the U.S., you need to submit a certificate of compliance (“sailing permit”) before you leave. To do so, you’ll need to submit Form 1040-C or Form 2063 to the IRS. Both of these are special tax returns or statements for the current year. You must also file a Form 1040-NR or 1040NR-EZ tax return.

Nonresidents Whose Home Countries Have Tax Treaties

Some nonresidents are covered by tax treaties that are in place between the U.S. and their home countries. Depending on the terms of the treaty, these nonresidents might be subject to more generous tax rules. There’s an excellent chance you might fall into this category because the U.S. has tax treaties with more than 60 countries.

State Rules for Nonresidents

State-level nonresident status is different from your status as a resident of the U.S. It simply means you work in a state where you don’t maintain a residence. You could be subject to state-level nonresident tax rules even if you’re considered a resident for federal tax purposes.