The taxation of foreign nationals living in the US depends on whether they qualify as resident or non resident aliens. Aliens are individuals who are not US citizens. Aliens are considered non residents unless they qualify as residents under one of two tests:
The Green Card Test
The Substantial Presence Test
An alien who does not meet the above tests may want to elect to be treated as a US resident for Tax purposes.
The Green Card Test, aliens are considered residents with respect to a tax year if they are lawful permanent residents at any time during the calendar year. This status is established with a 'Green Card' which is a Permanent Resident Card.
Green card status remains until it is rescinded by the government or judicially determined to be abandoned.
An alien can initiate abandonment of resident status by filing with USCIS or US consular officer. 1) Application for abandonment 2) US Permanent Resident Card (USCIS Form i-551) attached to a letter sent by certified mail that states intent to abandon resident status. The resident status is considered abandoned on the date that either of these two activities take place.
If the USCIS or US Consular Officer initiates a judicial determination, resident status will be considered to be abandoned when the final administrative order of abandonment is issued. To appeal with Federal Court a final decision is needed.
Substantial Presence Test: Aliens may qualify as residents if they meet the substantial presence test. This test considers the days in the US over a period of 3 years. At least 31 days in the current year and 183 days in the current year and previous 2 years.
It is calculated this way: current year number of days + 1/3 of the number of days in the previous year and 1/6 of the number of days in the 2nd prior year.
In most cases, the days the alien is in the United States as a teacher, student, or trainee on an “F,” “J,” “M,” or “Q” visa are not counted. This exception is for a limited period of time.
If you are in the US for any amount of time during a day then that counts as a day. So, if you fly in on the 1st and leave on the 2nd then that would count for 2 days. If you are just changing planes in the US then that day wouldn't count, but make sure both points are outside the US and you are simply switching flights.
The US means US states and territorial waters but not US possessions and territories.
Closer Connection Exception
Even if you meet the substantial presence test, you can still be treated as a nonresident alien if you: