It's the question that defines everything else: which forms you file, which structures you can use and which income you're taxed on. And it doesn't depend on your visa or your passport — it depends on the days you spent in the U.S.
Enter the days you were physically in the U.S. each year. Any day you were present counts, even if only for a few hours.
Students (F, M, J, Q), teachers/researchers and diplomats (A, G) can be "exempt individuals": their days don't count, for limited periods.
The IRS doesn't count "183 days this year." It counts a weighted average over three years.
This year's days + ⅓ of last year's + ⅙ of the year before
If the total reaches 183 or more — and you were also present at least 31 days this year — you meet the test and the IRS treats you as a tax resident.
Any day you were physically present, even part of the day. There are specific exceptions (transit of less than 24 hours to another country, days you couldn't leave because of a medical condition that arose there, certain commuters from Mexico and Canada).
There is the closer connection exception: if you were present fewer than 183 days this year, keep your tax home in another country and have stronger ties to it, you can file Form 8840 and continue to be treated as a non-resident. It must be filed on time — if you don't file it, you generally lose the exception.
Several income tax treaties have "tie-breaker" rules for when two countries consider you a resident. It is claimed on the return and requires an analysis of the specific treaty.
No. They are entirely separate: tax residency defines who you file with, not where you can legally live or work.
Quite a lot: you're taxed on your worldwide income (not just U.S.-source), you file a 1040 instead of a 1040-NR, the S-Corp door opens, your LLC's forms change and foreign asset reports appear. Your estate tax exposure changes too.
Did your result land near the line, or are you already over it?
That's exactly the case where a 15-minute consultation prevents a years-long problem: $29.