Alien Residency - Green Card Test
You are a resident, for tax purposes, if you are a Lawful Permanent Resident of the United States at any time during the calendar year. This is known as the "green card" test.
You are a Lawful Permanent Resident of the United States, at any time, if you have been given the privilege, according to the immigration laws, of residing permanently in the United States as an immigrant. You generally have this status if the U.S. Citizenship and Immigration Service (USCIS) issued you an alien registration card, Form I-551, also known as a "green card."
You continue to have resident status, under this test, unless you voluntarily renounce and abandon this status in writing to the USCIS, or your immigrant status is administratively terminated by the USCIS, or your immigrant status is judicially terminated by a U.S. federal court.
If you meet the green card test at anytime during the calendar year, but do not meet the substantial presence test for that year, your residency starting date is the first day on which you are present in the United States as a Lawful Permanent Resident. However, an alien who has been present in the United States at any time during a calendar year as a Lawful Permanent Resident may choose to be treated as a resident alien for the entire calendar year.