(2) Stock held by qualified shareholders not treated as United States real property interest (A) In general Except as provided in subparagraph (B)— (i) stock of a real estate investment trust which is held directly (or indirectly through 1 or more partnerships) by a qualified shareholder shall not be treated as a United States real property interest, and (ii) notwithstanding subsection (h)(1), any distribution to a qualified shareholder shall not be treated as gain recognized from the sale or exchange of a United States real property interest to the extent the stock of the real estate investment trust held by such qualified shareholder is not treated as a United States real property interest under clause (i). (B) Exception In the case of a qualified shareholder with one or more applicable investors— (i) subparagraph (A)(i) shall not apply to the applicable percentage of the stock of the real estate investment trust held by the qualified shareholder, and (ii) the applicable percentage of the amounts realized by the qualified shareholder with respect to any disposition of stock in the real estate investment trust or with respect to any distribution from the real estate investment trust attributable to gain from sales or exchanges of a United States real property interest shall be treated as amounts realized from the disposition of United States real property interests. (C) Special rule for certain distributions treated as sale or exchange If a distribution by a real estate investment trust is treated as a sale or exchange of stock under section 301(c)(3) , 302 , or 331 with respect to a qualified shareholder— (i) in the case of an applicable investor, subparagraph (B) shall apply with respect to such distribution, and (ii) in the case of any other person, such distribution shall be treated under section 857(b)(3)(F) as a dividend from a real estate investment trust notwithstanding any other provision of this title. (D) Applicable investor For purposes of this subsection, the term “applicable investor” means, with respect to any qualified shareholder holding stock in a real estate investment trust, a person (other than a qualified shareholder) which— (i) holds an interest (other than an interest solely as a creditor) in such qualified shareholder, and (ii) holds more than 10 percent of the stock of such real estate investment trust (whether or not by reason of the person’s ownership interest in the qualified shareholder). (E) Constructive ownership rules For purposes of subparagraphs (B)(i) and (D), the constructive ownership rules under subsection (c)(6)(C) shall apply. (F) Applicable percentage For purposes of subparagraph (B), the term “applicable percentage” means the percentage of the value of the interests (other than interests held solely as a creditor) in the qualified shareholder held by applicable investors.