Any gain (profit) on the sale of your home may be subject to the capital gains tax. Your gain (or loss) is determined by subtracting your cost basis from your selling price, less selling expenses. A loss on the sale of your home is not deductible on your return.
However, you may be able to exclude all or part of any gain. If this was your main home and, during the five-year period ending on the date of sale, you owned and lived in the home for at least two years, you can exclude up to $250,000 (single person) or up to $500,000 (married filing jointly and both qualify). The excess amount will be taxed at favorable capital gains rates. If you can exclude all your gain, you do not have to report the sale on your tax return unless you receive IRS Form 1099-S.
If you do not meet these tests, you may be able to exclude some of the gain if you meet certain other conditions, such as a change of place of employment or a move for health reasons. See the section called "Excluding the Gain: Reduced Maximum Exclusion" in IRS Pub 523 to find out whether you qualify for one of the exceptions.
If you need more details, you should read the entire Pub 523.