In order to use the Substantial Presence Test tool, you must first determine your days of presence in the United States for the last three tax years.
A day of presence is a day when you are physically present in the United States for more than 24 hours in a day.
Do not count the following as 'Days of Presence':
a) if you are commuting from Mexico or Canada in a day
b) you are a crew member in a foreign vessel
c) your stay got extended due to a medical condition
To meet the Substantial Presence Test, a foreign person must:
Be physically present in the US for at least 31 days during the current year, and
Be physically present for a minimum of 183 days during the 3 year period, that included the current year and the 2 years immediately before that, counting:
(a) All the days the individual was present in the current year, and
(b) 1/3 of the days the individual was present in the 1st year before the current year, and
(c) 1/6 of the days the individual was present in the 2nd year before the current year
Take the IRS Substantial Presence Test for Residency Determination: