What return you must file, as well as when and where you file thatreturn, depends on your status at the end of the tax year as aresident or a nonresident alien.