How Long Do You Need to Own Your Home to Escape Capital Gains Taxes on the Sale of It?

The primary residence sale exclusion can shield up to $500,000 of gain from taxes.

George Doyle/Stockbyte/Getty Images

Most people don't think of their home as a capital asset, so sometimes it comes as a surprise when they realize Uncle Sam taxes the gains on the sale. Though there is a large exclusion available to qualified sellers, there's no amount of time that you can own your home and be guaranteed not to pay any capital gains taxes on the sale.

Calculating Taxable Gain

You only have to worry about paying taxes on the sale of your home if your net proceeds exceed your basis for the home. Your basis equals the amount you paid to purchase the home, plus the cost of substantial improvements to the home. For example, if you paid $220,000 for the home and paid $20,000 to add on a garage, your basis is $240,000. Your net proceeds equal the sales price minus any costs of selling, such as broker commissions or advertising.

Primary Residence Exclusion

If you meet ownership and use tests, you can exclude up to $250,000 of the gain on the sale. If you're married and file a joint return, as a couple you can exclude up to $500,000 of the gain as long as you both meet the use test and at least one of you meets the ownership test. However, you can only use the exclusion once every two years.

Ownership and Use Tests

Both the ownership and use tests look at the five years prior to the sale. To meet the ownership test, you must have owned the home for at least two of those years. To meet the use test, it must have served as your primary residence for at least two of the five years. However, the ownership and use periods don't have to be the same two years. For example, say you rented the home during 2012, bought it and continued to use it as your primary residence in 2013, and then used it as a second home in 2014. You meet the use test because it was your primary residence for 2012 and 2013 and you meet the ownership test because you owned it in 2013 and 2014.

Holding Until Death

If you hold your home until your death, your heirs receive a step-up in basis so if they sell it for the same price as it's worth when you died, they won't pay any capital gains tax. For example, say you bought the home for $240,000 and it's worth $600,000 when you die. If you had sold the home, you would have a $360,000 capital gain. However, when you die, the basis for your heirs jumps to $600,000, so when it's sold for that same price, there's no gain to pay taxes on.