When you sell your home, the IRS allows one major form of capital gains break. It’s called the home sale exclusion, and it allows you to deduct a significant amount of the profit from your home sale to minimize or avoid capital gains taxes. If you’re selling an investment property, you can use the process known as a “like-kind” exchange to lower your tax burden, but this process only applies to investment and rental properties. Here’s what you need to know. For answers to your complex financial questions such as “Can you avoid capital gains tax by buying another home?” consider working with a financial advisor.
Home Sale Exclusions
If you’re selling a house, there are two main forms of tax breaks the IRS allows. The first tax break is called a Section 121 (commonly referred to as home sale exclusion), which allows taxpayers to exclude capital gains from the sale of their home. This means that it could only be applied to the primary residence where you live. In 2025, this exclusion allows individual taxpayers to exclude up to $250,000 from the sale of their primary home ($500,000 for joint taxpayers).
The second tax break is called Section 1031 (also called a like-kind exchange), which allows taxpayers to defer paying capital gains tax on an investment property sale by using the proceeds to buy another similar property.
Taxable capital gains only apply to the profit from the sale. Start with the sale price, then subtract what you paid for the home, plus any capital improvements and selling costs. This gives your total gain. From that, subtract the home sale exclusion. Any remaining amount is taxable.
Home Sale Exclusion Example
As an example, let’s say an individual bought a house for $200,000. Years later the individual sells it for $500,000. The potential capital gains tax on the sale would be $300,000, which is the profit made from the sale. Using the home sale exclusion, the seller could exclude $250,000 of the profit. and consequently owe tax on the remaining $50,000 in capital gains.
To qualify for the home sale exclusion your property must pass two tests:
- Ownership: Taxpayers must have owned this home for at least 24 out of the past 60 months (put another way, at least two years out of the last five). These months do not have to be consecutive.
- Use and occupancy: The house must have been used as a primary residence for at least two of the past five years, meaning you had to live in it. There are several ways of formally establishing primary residence. Most importantly, this must have been the address for filing taxes, voting, state and federal IDs and utility bills.
You should note that you can only have one legal primary residence at a time. This means you can only apply the home sale exclusion to one sale at a time. The home sale exclusion does not apply to investment or rental properties. This must be a home that you live in and it cannot be a second home.
Taking Advantage of Like-Kind Exchanges

The IRS defines like-kind exchanges as exchanges between real properties that are used for business or held as an investment for another business that is the same type or like-kind. Generally, when sellers make this type of exchange, they are not required to immediately recognize a gain or loss under Internal Revenue Code Section 1031. This means that if you own business property, the IRS allows you to sell one property and use the proceeds to buy another without having to pay current capital gains taxes on the transaction.
This once applied to all forms of business assets, however, Congress eliminated like-kind exchanges for all assets in 2017. This tax benefit is limited to real estate held for business or investment purposes, such as rental properties, offices, shops, hotels and other in-use assets. It created a dedicated benefit for closely or individually held real estate firms.
Life-Kind Exchanges Requirements
Like-kind exchanges must meet several requirements:
- This property must be held as an investment asset. It cannot be a home for personal use, whether as a primary residence, secondary residence or even an occasional vacation home. As a general rule, if you ever stay at this property it will probably not count for a 1031-like-kind exchange.
- The replacement property must be a like-kind property, meaning it must also be business or investment real estate.
- Both properties have to be in the United States.
- The 1031 exchange must take place on a strict timeline.
- A qualified intermediary must receive and hold the cash from the sale and use it to buy the replacement property. The property owner cannot hold those funds.
- In some circumstances, differences in debt or cash (called “boot”) can result in a current tax liability.
How Like-Kind Exchanges Work
You do not need to make a direct swap in a like-kind exchange. Instead, once you sell your first investment property you can put the proceeds from this sale into escrow. You then have 45 days to identify the replacement property, and 180 days to finalize the purchase. This new purchase must also generate income through rentals or other use. It must also be exclusively for business or investment purposes.
You can then use your escrowed funds to buy this property. If you do so, the IRS allows you to consider this an exchange and lets you defer the capital gains taxes on the proceeds from your original sale. If you own a rental property and would like to upgrade it, this can be an extremely useful tool. However, it is not available for homeowners, as like-kind exchanges specifically do not apply to your private residence.
Keep in mind that if any part of the transaction results in a taxable capital gain—such as receiving cash or non-like-kind property—you may still owe taxes on that portion. The rules around timing, property use and reinvestment are strict, so missing a step can lead to unexpected tax liability.
Bottom Line

You can avoid a large part of capital gains taxes on your primary home by using the home sale exclusion. For investment properties, you may be able to defer capital gains by using a like-kind exchange, which lets you roll the sale proceeds into another investment property. This option isn’t available for personal residences. Take note that taxable capital gains only apply to your profit after subtracting your purchase price, improvements and selling costs.
Property Buying Tips for Beginners
- A financial advisor can help you create a financial plan for your home buying needs and goals. Finding a financial advisor doesn’t have to be hard. SmartAsset’s free tool matches you with vetted financial advisors who serve your area. You can have a free introductory call with your advisor matches to decide which one you feel is right for you. If you’re ready to find an advisor who can help you achieve your financial goals, get started now.
- Picking between a dream home and an investment property could be difficult. Depending on your financial needs and goals, here’s why a long-term rental property could pay off.
Photo credit: ©iStock.com/LifestyleVisuals, ©iStock.com/PeopleImages, ©iStock.com/Jirapong Manustrong