the partnership and all members of such group shall be treated as a single taxpayer during such period. (5) Related persons (A) In general The term domestic textile production gross receipts shall not include any gross receipts of the taxpayer derived from property leased, licensed, or rented by the taxpayer for use by any related person. (B) Related person For purposes of subparagraph (A), a person shall be treated as related to another person if such persons are treated as a single employer under subsection (a) or (b) of section 52 or subsection (m) or (o) of section 414, except that determinations under subsections (a) and (b) of section 52 shall be made without regard to section 1563(b). (d) Definitions and special rules (1) Special rule for affiliated groups (A) In general All members of an expanded affiliated group shall be treated as a single corporation for purposes of this section. (B) Expanded affiliated group For purposes of this section, the term expanded affiliated group means an affiliated group as defined in section 1504(a), determined— (i) by substituting more than 50 percent for at least 80 percent each place it appears, and (ii) without regard to paragraphs (2) and (4) of section 1504(b). (C) Allocation of deduction Except as provided in regulations, the deduction under subsection (a) shall be allocated among the members of the expanded affiliated group in proportion to each member's respective amount (if any) of qualified textile production activities income. (2) Trade or business requirement This section shall be applied by only taking into account items which are attributable to the actual conduct of a trade or business. (3) Unrelated business taxable income For purposes of determining the tax imposed by section 511, subsection (a)(1)(B) shall be applied by substituting unrelated business taxable income for taxable income . (4) Regulations The Secretary shall prescribe such regulations as are necessary to carry out the purposes of this section, including regulations which prevent more than 1