(6) Treatment of property owned by partnerships, etc. (A) In general For purposes of this subsection, if— (i) any property which (but for this subparagraph) is not tax-exempt use property is owned by a partnership which has both a tax-exempt entity and a person who is not a tax-exempt entity as partners, and (ii) any allocation to the tax-exempt entity of partnership items is not a qualified allocation, an amount equal to such tax-exempt entity’s proportionate share of such property shall (except as provided in paragraph (1)(D)) be treated as tax-exempt use property. (B) Qualified allocation For purposes of subparagraph (A), the term “qualified allocation” means any allocation to a tax-exempt entity which— (i) is consistent with such entity’s being allocated the same distributive share of each item of income, gain, loss, deduction, credit, and basis and such share remains the same during the entire period the entity is a partner in the partnership, and (ii) has substantial economic effect within the meaning of section 704(b)(2). For purposes of this subparagraph, items allocated under section 704(c) shall not be taken into account. (C) Determination of proportionate share (i) In general For purposes of subparagraph (A), a tax-exempt entity’s proportionate share of any property owned by a partnership shall be determined on the basis of such entity’s share of partnership items of income or gain (excluding gain allocated under section 704(c) ), whichever results in the largest proportionate share. (ii) Determination where allocations vary For purposes of clause (i), if a tax-exempt entity’s share of partnership items of income or gain (excluding gain allocated under section 704(c) ) may vary during the period such entity is a partner in the partnership, such share shall be the highest share such entity may receive. (D) Determination of whether property used in unrelated trade or business For purposes of this subsection, in the case of any property which is owned by a partnership which has both a tax-exempt entity and a person who is not a tax-exempt entity as partners, the determination of whether such property is used in an unrelated trade or business of such an entity shall be made without regard to section 514. (E) Other pass-thru entities; tiered entities Rules similar to the rules of subparagraphs (A), (B), (C), and (D) shall also apply in the case of any pass-thru entity other than a partnership and in the case of tiered partnerships and other entities. (F) Treatment of certain taxable entities (i) In general For purposes of this paragraph and paragraph (5), except as otherwise provided in this subparagraph, any tax-exempt controlled entity shall be treated as a tax-exempt entity. (ii) Election If a tax-exempt controlled entity makes an election under this clause— (I) such entity shall not be treated as a tax-exempt entity for purposes of this paragraph and paragraph (5), and (II) any gain recognized by a tax-exempt entity on any disposition of an interest in such entity (and any dividend or interest received or accrued by a tax-exempt entity from such tax-exempt controlled entity) shall be treated as unrelated business taxable income for purposes of section 511. Any such election shall be irrevocable and shall bind all tax-exempt entities holding interests in such tax-exempt controlled entity. For purposes of subclause (II), there shall only be taken into account dividends which are properly allocable to income of the tax-exempt controlled entity which was not subject to tax under this chapter. (iii) Tax-exempt controlled entity (I) In general The term “tax-exempt controlled entity” means any corporation (which is not a tax-exempt entity determined without regard to this subparagraph and paragraph (2)(E)) if 50 percent or more (in value) of the stock in such corporation is held by 1 or more tax-exempt entities (other than a foreign person or entity). (II) Only 5-percent shareholders taken into account in case of publicly traded stock For purposes of subclause (I), in the case of a corporation the stock of which is publicly traded on an established securities market, stock held by a tax-exempt entity shall not be taken into account unless such entity holds at least 5 percent (in value) of the stock in such corporation. For purposes of this subclause, related entities (within the meaning of paragraph (4)) shall be treated as 1 entity. (III) Section 318 to apply For purposes of this clause, a tax-exempt entity shall be treated as holding stock which it holds through application of section 318 (determined without regard to the 50-percent limitation contained in subsection (a)(2)(C) thereof). (G) Regulations For purposes of determining whether there is a qualified allocation under subparagraph (B), the regulations prescribed under paragraph (8) for purposes of this paragraph— (i) shall set forth the proper treatment for partnership guaranteed payments, and (ii) may provide for the exclusion or segregation of items.