If you are a nonresident alien and you must file an income tax return, use Form 1040NR, U.S. Nonresident Alien Income Tax Return, unless you qualify to use Form 1040NR-EZ, U.S. Income Tax Return for Certain Nonresident Aliens With No Dependents.
If you have income from which no (or not enough) U.S. tax is withheld, you also may need to file Form 1040-ES (NR), U.S. Estimated Tax for Nonresident Alien Individuals.
Before leaving the United States, you may have to file Form 1040-C, U.S. Departing Alien Income Tax Return or Form 2063, U.S. Departing Alien Income Tax Statement.
These forms are briefly discussed later. Be sure to get Publication 519, which is a comprehensive tax guide for aliens.