; or (II) in the case of an acquisition with respect to a domestic partnership, by former partners of the domestic partnership by reason of holding a capital or profits interest in the domestic partnership; or (ii) the management and control of the expanded affiliated group which includes the entity occurs, directly or indirectly, primarily within the United States, as determined pursuant to regulations prescribed by the Secretary of the Treasury, and such expanded affiliated group has significant domestic business activities. (2) Exception for corporations with substantial business activities in foreign country of organization (A) In general A foreign incorporated entity described in paragraph (1) shall not be treated as an inverted domestic corporation if after the acquisition the expanded affiliated group which includes the entity has substantial business activities in the foreign country in which or under the law of which the entity is created or organized when compared to the total business activities of such expanded affiliated group. (B) Substantial business activities The Secretary of the Treasury (or the Secretary's delegate) shall establish regulations for determining whether an affiliated group has substantial business activities for purposes of subparagraph (A), except that such regulations may not treat any group as having substantial business activities if such group would not be considered to have substantial business activities under the regulations prescribed under section 7874 of the Internal Revenue Code of 1986, as in effect on January 18, 2017. (3) Significant domestic business activities (A) In general For purposes of paragraph (1)(B)(ii), an expanded affiliated group has significant domestic business activities if at least 25 percent of— (i) the employees of the group are based in the United States; (ii) the employee compensation incurred by the group is incurred with respect to employees based in the United States; (iii) the assets of the group are located in the United States