combination of both such types of plans. (D) Plans must meet requirements without taking into account Social Security and similar contributions and benefits A rule similar to the rule of section 416(e) shall apply. (d) Qualified wages and compensation For purposes of this section— (1) In general The term qualified wages means wages (as defined in section 51(c), determined without regard to paragraph (4) thereof) paid or incurred by the Patriot employer during the taxable year to employees— (A) who perform substantially all of their services for such Patriot employer inside the United States, and (B) with respect to whom— (i) in the case of a Patriot employer which employs an average of more than 50 employees on business days during the taxable year, the requirements of subclauses (I) and (II) of subsection (b)(1)(D)(i) are met, and (ii) in the case of any other Patriot employer, the requirements of either subclause (I) or (II) of subsection (b)(1)(D)(i) are met. (2) Special rules for agricultural labor and railway labor Rules similar to the rules of section 51(h) shall apply. (3) Compensation For purposes of subsections (b)(1)(D)(i)(I) and (c), the term compensation has the same meaning as qualified wages, except that section 51(c)(2) shall be disregarded in determining the amount of such wages. (e) Aggregation Rules For purposes of this section— (1) In general All persons treated as a single employer under subsection (a) or (b) of section 52 shall be treated as a single taxpayer. (2) Special rules for certain requirements For purposes of applying paragraphs (1)(A) and (2)(A) of subsection (b)— (A) the determination under subsections (a) and (b) of section 52 for purposes of paragraph (1) shall be made without regard to section 1563(b)(2)(C) (relating to exclusion of foreign corporations), and (B) if any person treated as a single taxpayer under this subsection (after application of subparagraph (A)), or any predecessor of such person, was an expatriated entity (as defined in section 7874(a)(2)) for any taxable