(6) Exemptions not to apply to certain transactions (A) In general In the case of a trust described in section 401(a) which is part of a plan providing contributions or benefits for employees some or all of whom are owner-employees (as defined in section 401(c)(3)), the exemptions provided by subsection (d) (other than paragraphs (9) and (12)) shall not apply to a transaction in which the plan directly or indirectly— (i) lends any part of the corpus or income of the plan to, (ii) pays any compensation for personal services rendered to the plan to, or (iii) acquires for the plan any property from, or sells any property to, any such owner-employee, a member of the family (as defined in section 267(c)(4)) of any such owner-employee, or any corporation in which any such owner-employee owns, directly or indirectly, 50 percent or more of the total combined voting power of all classes of stock entitled to vote or 50 percent or more of the total value of shares of all classes of stock of the corporation. (B) Special rules for shareholder-employees, etc. (i) In general For purposes of subparagraph (A), the following shall be treated as owner-employees: (I) A shareholder-employee. (II) A participant or beneficiary of an individual retirement plan (as defined in section 7701(a)(37) ). (III) An employer or association of employees which establishes such an individual retirement plan under section 408(c). (ii) Exception for certain transactions involving shareholder-employees Subparagraph (A)(iii) shall not apply to a transaction which consists of a sale of employer securities to an employee stock ownership plan (as defined in subsection (e)(7)) by a shareholder-employee, a member of the family (as defined in section 267(c)(4)) of such shareholder-employee, or a corporation in which such a shareholder-employee owns stock representing a 50 percent or greater interest described in subparagraph (A). (iii) Loan exception For purposes of subparagraph (A)(i), the term “owner-employee” shall only include a person described in subclause (II) or (III) of clause (i). (C) Shareholder-employee For purposes of subparagraph (B), the term “shareholder-employee” means an employee or officer of an S corporation who owns (or is considered as owning within the meaning of section 318(a)(1)) more than 5 percent of the outstanding stock of the corporation on any day during the taxable year of such corporation.