a domestic partnership, and (B) after the acquisition, more than 50 percent of the stock (by vote or value) of the entity is held— (i) in the case of an acquisition with respect to a domestic corporation, by former shareholders of the domestic corporation by reason of holding stock in the domestic corporation, 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. (3) Exception for corporations with substantial business activities in foreign country of organization A foreign corporation described in paragraph (2) 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. For purposes of subsection (a)(2)(B)(iii) and the preceding sentence, the term substantial business activities shall have the meaning given such term under regulations in effect on May 8, 2014, except that the Secretary may issue regulations increasing the threshold percent in any of the tests under such regulations for determining if business activities constitute substantial business activities for purposes of this paragraph. . (b) Conforming amendments (1) Clause (i) of section 7874(a)(2)(B) of the Internal Revenue Code of 1986 is amended by striking after March 4, 2003, and inserting after March 4, 2003, and before May 9, 2014, . (2) Subsection (c) of section 7874 of such Code is amended— (A) in paragraph (2)— (i) by striking subsection (a)(2)(B)(ii) and inserting subsections (a)(2)(B)(ii) and (b)(2)(B) , and (ii) by inserting or (b)(2)(A) after (a)(2)(B)(i) in subparagraph (B), (B) in paragraph (3), by inserting or (b)(2)(B), as the case may be, after (a)(2)(B)(ii) , (C) in paragraph (5), by striking