Capital Gains Tax Rules on Real Estate Sales

Selling real estate can bring a massive financial windfall, but the IRS will inevitably want its share of your profits. Fortunately, the tax code is full of legal exemptions designed to help homeowners and investors keep more of their money. By understanding specific capital gains tax rules, you can significantly minimize the taxes you owe when selling a primary residence or rental property.

Understanding Capital Gains Taxes on Real Estate

When you sell a piece of real estate for more than you paid for it, the profit is called a capital gain. The IRS taxes these gains differently depending on how long you owned the property.

If you sell a house after owning it for one year or less, you will pay short-term capital gains tax. The IRS treats short-term gains just like the money you earn at your job. This means the profit is taxed at your ordinary income tax rate, which can reach up to 37% for top earners.

If you hold the property for more than one year, you unlock long-term capital gains tax rates. These rates are much more favorable. Depending on your taxable income and filing status, your long-term capital gains tax rate will be 0%, 15%, or 20%. For the 2024 tax year, married couples filing jointly pay 0% if their total income is under $94,050. They pay 15% on income up to $583,750, and 20% on anything above that threshold.

Primary Residence Tax Exemptions

The most powerful tax break in real estate applies strictly to the home you live in. Under Section 121 of the IRS tax code, you can exclude a massive portion of your profit from capital gains taxes when you sell your primary residence.

Single filers can exclude up to $250,000 in capital gains. Married couples filing a joint return can exclude up to $500,000. If you and your spouse bought a house for $400,000 and sold it years later for $850,000, your entire $450,000 profit is completely tax-free.

The Two-in-Five Rule

To qualify for the Section 121 exclusion, you must pass the “two-in-five” rule. The IRS requires you to meet two specific tests:

  • The Ownership Test: You must have owned the home for at least two years out of the five years immediately preceding the sale.
  • The Use Test: You must have lived in the home as your primary residence for at least 24 months out of that same five-year period.

The 24 months do not need to be consecutive. You can live in the house for a year, rent it out for three years, and move back in for a final year to meet the requirement. You can only claim this full exemption once every two years.

Partial Exemptions

If you are forced to sell your home before meeting the two-year requirement, you might still catch a break. The IRS allows partial exclusions if you must move due to specific unforeseen circumstances. These include a job relocation at least 50 miles away, a diagnosis of a severe health condition, or a divorce.

Tax Rules for Selling a Rental Property

Selling an investment property triggers entirely different rules. The IRS does not allow you to use the standard $250,000 or $500,000 exclusion for properties that are strictly used as rentals. When you sell an investment property, you will face standard capital gains taxes alongside two extra tax hurdles.

Depreciation Recapture

While you own a rental property, the IRS allows you to deduct the cost of the building over 27.5 years through a process called depreciation. This lowers your income tax bill each year. However, when you sell the property, the IRS wants those tax savings back. This is known as depreciation recapture. The IRS taxes the total amount of depreciation you claimed (or were legally allowed to claim) at a flat rate of 25%.

Net Investment Income Tax

High earners must also prepare for the Net Investment Income Tax. This is an additional 3.8% tax applied to investment income, which includes real estate profits. For 2024, this extra tax hits single filers with a Modified Adjusted Gross Income over $200,000 and married couples filing jointly with an income over $250,000.

Strategies to Minimize Taxes on Rental Properties

Just because rental properties face stricter taxes does not mean you have to pay them right away. Investors have several legal strategies to defer or eliminate these costs.

The 1031 Exchange

A 1031 exchange is the most popular way to defer taxes on a rental property. Under Section 1031 of the tax code, you can roll the profits from the sale of one investment property directly into the purchase of another “like-kind” property. If executed correctly, you pay zero capital gains tax and zero depreciation recapture at the time of the sale.

The IRS enforces strict timelines for a 1031 exchange:

  • You have exactly 45 days from the sale of your original property to identify potential replacement properties.
  • You have exactly 180 days from the sale to close on the new property.
  • You must use a Qualified Intermediary to hold the funds. If the cash touches your personal bank account, the exchange is void and taxes are due immediately.

Converting a Rental to a Primary Residence

You can eventually claim the Section 121 exclusion on a rental property if you move into it. If you convert the rental into your primary home and live there for at least two years, you can exclude a portion of the capital gains. The IRS prorates the exclusion based on how many years the property was used as a rental versus a primary residence. Keep in mind that you will still have to pay the 25% depreciation recapture tax on the years it was rented out.

Maximize Your Cost Basis

Taxes are calculated on your profit, not the total sale price. Your profit is the sale price minus your “cost basis.” Your initial cost basis is what you paid for the house, but you can increase this number by keeping track of major capital improvements.

If you bought a rental for $300,000 and later spent $20,000 on a new roof and $10,000 on a new HVAC system, your cost basis is now $330,000. When you sell the house, that $30,000 in improvements directly reduces your taxable profit. Regular maintenance, like painting walls or fixing a leaky faucet, does not count toward your cost basis.

Frequently Asked Questions

How much is capital gains tax on real estate? If you own the property for less than one year, you pay short-term capital gains at your ordinary income tax rate (which caps at 37%). If you own it for more than a year, you pay long-term capital gains tax at 0%, 15%, or 20%, depending on your total taxable income for the year.

Can I avoid paying capital gains tax if I buy another house? If you are selling a primary residence, buying another house does not affect your taxes. You simply use the Section 121 exemption to exclude up to $500,000 in profit. If you are selling an investment property, you can defer taxes by using a 1031 exchange to buy another investment property of equal or greater value.

What is depreciation recapture? When you own a rental property, the IRS lets you deduct the wear and tear of the physical building from your taxes over a period of 27.5 years. When you eventually sell the property, the IRS reclaims those tax breaks by taxing the total depreciation amount you claimed at a flat 25% rate.