Even if you’re not an American citizen, if you live in the United States or spend a significant amount of time there, you still need to pay U.S. income tax.
Resident or non-resident alien
The IRS uses two tests — the green card test and the substantial presence test — for assessing your alien status. If you satisfy the requirements of either one, you’re considered a resident alien for income tax purposes; otherwise, you’re treated as a non-resident alien.
If you’re an alien with a green card, meaning the U.S. Citizenship and Immigration Service allows you to reside in the country legally, you are a resident alien. However, if you don’t have a green card and spend at least 31 days in the U.S. during the current tax year and a total of 183 days during the last three tax years (inclusive of the current tax year), you’ll usually satisfy the physical presence test and are also treated as a resident alien.
Counting 183 days
When counting the number of days you’re present in the U.S. during the three-year period, you don’t include every single day. Instead, count only a fraction of the days in two of the three years. Suppose, for example, you’re trying to figure out your status for the 2014 tax year because you lived in the U.S. for 60 days. You count all 60 days for 2014, one-third of the days in 2013 and one-sixth of the days in 2012. Therefore, if you were in the U.S. for 120 days in 2013 and 180 days in 2012, only include 40 days for 2013 and 30 days for 2012, with the total for the three-year period being 130 days. In this scenario, you pay income tax as a non-resident alien.
Also, do not count days when you are physically present in the US under the following circumstances:
Days you commute to work in the United States from a residence in Canada or Mexico if you regularly commute from Canada or Mexico.
Days you are in the United States for less than 24 hours when you are in transit between two places outside the United States.
Days you are in the United States as a crew member of a foreign vessel.
Days you are unable to leave the United States because of a medical condition that arose while you are in the United States.
Days you are an “exempt individual”.
An “exempt individual” for purposes of this test refers to the following individuals:
An individual temporarily present in the United States as a foreign government-related individual under an “A” or “G” visa.
A teacher or trainee temporarily present in the United States under a “J” or “Q” visa, who substantially complies with the requirements of the visa.
A student temporarily present in the United States under an “F,” “J,” “M,” or “Q” visa, who substantially complies with the requirements of the visa.
A professional athlete temporarily in the United States to compete in a charitable sports event.
Resident alien taxes
As a legal U.S. resident, you’re subject to the same tax rules as U.S. citizens. This means that you must report all income you earn on annual tax returns, regardless of which country in which you earn it. When you prepare your return, you can always use the 1040, or if eligible, the 1040A or 1040EZ.
Non-resident taxes
A non-resident must also pay income taxes to the IRS but only on the income that’s effectively connected to the U.S., which generally includes the money you earn while in the U.S. The IRS, however, has no authority to impose tax on the income that non-residents earn in their home countries or in any foreign country for that matter. When you prepare your U.S. tax return, you must use Form 1040NR or the shorter 1040NR-EZ, if eligible. Regardless of the form you use, you will only report amounts that are considered US-source income. Just like resident aliens and U.S. citizens, there are deductions and credits you can claim to reduce your taxable income.
Dual-Status Taxpayer
In the year of transition between being a nonresident and a resident for tax purposes, you are generally considered a Dual-Status Taxpayer. A Dual-Status Taxpayer files two tax returns for the year—one return for the portion of the year when considered a nonresident, and another return for the portion of the year considered a resident. In some situations, a taxpayer can elect to be treated as a full-year resident in the transition year to avoid having to file two separate returns.
Source: Turbotax