Publication 519 (2021), U.S. Tax Guide for Aliens | Internal ... You were exempt as a teacher, trainee, or student for any part of 3 (or fewer) of the 6 preceding calendar years. A foreign employer paid all of your compensation during 2021. You were present in the United States as a teacher or trainee in any of the 6 prior years.