for tax purpose, if you meet the 183 (present in US) days test, you will be treated as residence, to count the 183 days, you must count all days in US in current year, plus 1/3 of days you were in US last year and 1/6 days you were in US the year before.