Exception for certain active interests in partnerships and S corporations
In the case of a disposition of an interest in a partnership or S corporation—
(A) gain from such disposition shall be taken into account under clause (iii) of paragraph (1)(A) only to the extent of the net gain which would be so taken into account by the transferor if all property of the partnership or S corporation were sold for fair market value immediately before the disposition of such interest, and
(B) a rule similar to the rule of subparagraph (A) shall apply to a loss from such disposition.