(1) a sale of real property gives rise to indebtedness to the seller which is secured by the real property sold, and
(2) the seller of such property reacquires such property in partial or full satisfaction of such indebtedness,
(1) In general
In the case of a reacquisition of real property to which subsection (a) applies, gain shall result from such reacquisition to the extent that—
(A) the amount of money and the fair market value of other property (other than obligations of the purchaser) received, prior to such reacquisition, with respect to the sale of such property, exceeds
(B) the amount of the gain on the sale of such property returned as income for periods prior to such reacquisition.
(2) Limitation
The amount of gain determined under paragraph (1) resulting from a reacquisition during any taxable year beginning after the date of the enactment of this section shall not exceed the amount by which the price at which the real property was sold exceeded its adjusted basis, reduced by the sum of—
(A) the amount of the gain on the sale of such property returned as income for periods prior to the reacquisition of such property, and
(B) the amount of money and the fair market value of other property (other than obligations of the purchaser received with respect to the sale of such property) paid or transferred by the seller in connection with the reacquisition of such property.
For purposes of this paragraph, the price at which real property is sold is the gross sales price reduced by the selling commissions, legal fees, and other expenses incident to the sale of such property which are properly taken into account in determining gain or loss on such sale.
(3) Gain recognized
Except as provided in this section, the gain determined under this subsection resulting from a reacquisition to which subsection (a) applies shall be recognized, notwithstanding any other provision of this subtitle.
(1) the amount of the gain determined under subsection (b) resulting from such reacquisition, and
(2) the amount described in subsection (b)(2)(B).
(1) such seller shall be considered as receiving, upon the reacquisition of such property, an amount equal to the amount of such indebtedness treated by him as having become worthless, and
(2) the adjusted basis of such indebtedness shall be increased (as of the date of reacquisition) by an amount equal to the amount so considered as received by such seller.
(1) subsection (a) applies to a reacquisition of real property with respect to the sale of which gain was not recognized under section 121 (relating to gain on sale of principal residence); and
(2) within 1 year after the date of the reacquisition of such property by the seller, such property is resold by him,
(1) for purposes of subsection (a), acquisition of real property by the taxpayer shall be treated as reacquisition by the seller, and
(2) the basis of the real property acquired by the taxpayer shall be increased by an amount equal to the deduction under which would (but for this subsection) have been allowable to the taxpayer with respect to the gain on the exchange of the obligation for the real property.