(5) Exempt individual defined For purposes of this subsection— (A) In general An individual is an exempt individual for any day if, for such day, such individual is— (i) a foreign government-related individual, (ii) a teacher or trainee, (iii) a student, or (iv) a professional athlete who is temporarily in the United States to compete in a sports event— (I) which is organized for the primary purpose of benefiting an organization which is described in section 501(c)(3) and exempt from tax under section 501(a), (II) all of the net proceeds of which are contributed to such organization, and, (III) which utilizes volunteers for substantially all of the work performed in carrying out such event. (B) Foreign government-related individual The term “foreign government-related individual” means any individual temporarily present in the United States by reason of— (i) diplomatic status, or a visa which the Secretary (after consultation with the Secretary of State) determines represents full-time diplomatic or consular status for purposes of this subsection, (ii) being a full-time employee of an international organization, or (iii) being a member of the immediate family of an individual described in clause (i) or (ii). (C) Teacher or trainee The term “teacher or trainee” means any individual— (i) who is temporarily present in the United States under subparagraph (J) or (Q) of section 101(15) of the Immigration and Nationality Act (other than as a student), and (ii) who substantially complies with the requirements for being so present. (D) Student The term “student” means any individual— (i) who is temporarily present in the United States— (I) under subparagraph (F) or (M) of section 101(15) of the Immigration and Nationality Act, or (II) as a student under subparagraph (J) or (Q) of such section 101(15), and (ii) who substantially complies with the requirements for being so present. (E) Special rules for teachers, trainees, and students (i) Limitation on teachers and trainees An individual shall not be treated as an exempt individual by reason of clause (ii) of subparagraph (A) for the current year if, for any 2 calendar years during the preceding 6 calendar years, such person was an exempt person under clause (ii) or (iii) of subparagraph (A). In the case of an individual all of whose compensation is described in section 872(b)(3), the preceding sentence shall be applied by substituting “4 calendar years” for “2 calendar years”. (ii) Limitation on students For any calendar year after the 5th calendar year for which an individual was an exempt individual under clause (ii) or (iii) of subparagraph (A), such individual shall not be treated as an exempt individual by reason of clause (iii) of subparagraph (A), unless such individual establishes to the satisfaction of the Secretary that such individual does not intend to permanently reside in the United States and that such individual meets the requirements of subparagraph (D)(ii).