http://www.law.cornell.edu/uscode/text/26/382
(g) Ownership change
For purposes of this section—
(1) In general
There is an ownership change if, immediately after any owner shift involving a 5-percent shareholder or any equity structure shift—
(A)the percentage of the stock of the loss corporation owned by 1 or more 5-percent shareholders has increased by more than 50 percentage points, over
(B)the lowest percentage of stock of the loss corporation (or any predecessor corporation) owned by such shareholders at any time during the testing period.
(2) Owner shift involving 5-percent shareholder
There is an owner shift involving a 5-percent shareholder if—
(A)there is any change in the respective ownership of stock of a corporation, and
(B)such change affects the percentage of stock of such corporation owned by any person who is a 5-percent shareholder before or after such change.