A nonresident alien is a foreign national subject to US taxes but who does not meet the “resident alien” definition. To qualify as a resident alien, you must meet one of two tests:
The Green Card Test: Hold a green card
The Substantial Presence Test: Have spent over 183 days in the US over the past three years, counting:
All the days in the current year
⅓ of the days last year
⅙ of the days two years ago