Figuring the Gain
If the amount realized is more than the adjusted basis, the difference is a gain and the taxpayer may be able to exclude all or part of it. If the amount realized is less than the adjusted basis, the difference is a nondeductible loss.
Click here to view Worksheet 2 (from Publication 523) which can be used to figure the gain or loss, the exclusion, and the taxable gain from a sale. Note that line 3 is the amount realized, line 4 is the adjusted basis, and line 5 is the amount of gain or loss from the sale.
Gain = Amount realized > Adjusted basis
Taxpayers who claimed the first-time homebuyer credit may be required to repay the credit in the year of sale. The repayment is limited to the amount of gain on the sale. For more information on how to adjust the basis of the home if the first-time homebuyer credit was received and exceptions to the repayment rule, see the Form 5405 Instructions.
Gain from the sale or exchange of a main home is not excludable from income if allocable to periods of nonqualified use. Generally, nonqualified use means any period in 2009 or later where neither the taxpayer nor spouse (or former spouse) used the property as a main home (with certain exceptions). Refer to Publication 523 for the list of exceptions to a period of nonqualified use. To figure the portion of nonqualified use, multiply the gain by the following fraction:
Total nonqualified use during period of ownership in 2009 or later
This issue can be complex. Refer taxpayers with "nonqualified use" issues to a professional tax preparer.