That was the old rule. Under current tax law, you can sell your residence and if you qualify you can exclude the gain.
Your sale qualifies for exclusion of $250,000 gain ($500,000 if married filing jointly) if the following is true:
- You owned the home and used it as your main home during at least 2 of the last 5 years before the date of sale.
- You did not acquire the home through a like-kind exchange (also known as a 1031 exchange), during the past 5 years.
- You did not claim any exclusion for the sale of a home that occurred during a 2-year period ending on the date of the sale of the home, the gain from which you now want to exclude.
If all three of the above are true, you won't have to pay tax on up to $250,000 ($500,000 if married filing jointly) of gain on the sale of your home.
See
IRS Publication 523 - Selling
Your Home for more information.