The short answer
Yes. Rev. Proc. 2005-14 lets one sale use both: section 121 excludes gain first, up to $250,000 or $500,000 for a qualifying joint return, and section 1031 then defers what is left, including the depreciation the exclusion cannot touch. Two conditions make it work: you owned and lived in the property as your main home for two of the five years before the sale, and it is investment or business property on the day you exchange it. A bonus most sellers miss is that cash you take out is not taxed as boot until it exceeds the excluded gain.
At a glance
| Order | Section 121 first, then section 1031 on the remaining gain |
|---|---|
| Exclusion cap | $250,000, or $500,000 on a qualifying joint return |
| Use test | Owned and used as main home 2 of the 5 years before the sale |
| Exchange test | Property must be held for investment or business when exchanged |
| Depreciation | Never excluded, but can be deferred by the exchange |
| Cash out | Taxed as boot only to the extent it exceeds the excluded gain |
| Replacement basis | Increased by the excluded gain |
| Form 8824 | Write 'Section 121 exclusion' and the amount on line 19 |
Both rules can apply because they ask different questions
Section 121(a) looks back five years: was the property 'owned and used by the taxpayer as the taxpayer's principal residence for periods aggregating 2 years or more'? It does not ask what the property is on the sale date. Section 1031 looks at the present: is the property held for investment or business when you exchange it?
A house you lived in, then rented out, can answer yes to both. Rev. Proc. 2005-14 confirms it in its first example, where the owner lived in a house for four years, rented it for less than three and exchanged it for a rental townhouse.
The revenue procedure applies only to taxpayers who satisfy the investment-use test for both the property given up and the replacement. A home you just moved out of and never rented is a weak case; the rental record after move-out is what makes it exchange property.
The procedure sets the order: exclude, defer, then rebuild basis
Section 4.02 of the revenue procedure says 'section 121 must be applied to gain realized before applying section 1031'. The exclusion takes its share first, and the exchange defers the rest.
Depreciation is the piece that crosses over. Under section 121(d)(6) the exclusion does not apply to depreciation after May 6, 1997, 'however, section 1031 may apply to such gain'. Deferring that slice is often the whole reason to exchange instead of simply selling.
Cash is treated generously. Boot 'is taken into account only to the extent the boot exceeds the gain excluded under section 121'. In return, the excluded gain is treated as recognized when you compute the replacement's basis, so the replacement's basis rises by the excluded amount.
Worked example: $700,000 of gain, $500,000 excluded, $500,000 taken in cash
Hypothetical, round numbers; run your own numbers with your CPA. A married couple lived in a house from 2019 to 2024, then rented it out and claimed $30,000 of depreciation. In 2026 they sell for $1,200,000. Adjusted basis is $500,000, so realized gain is $700,000.
Both spouses meet the use test, so they exclude $500,000. The remaining $200,000, which includes the $30,000 of depreciation, is deferred if they buy like-kind property. They buy a $700,000 rental and take $500,000 in cash. Because the cash does not exceed the excluded gain, none of it is taxed.
The replacement's basis is $500,000: the old $500,000 basis, plus the $500,000 excluded, minus the $500,000 of cash. That matches the $700,000 cost less the $200,000 deferred. On Form 8824 they write 'Section 121 exclusion' and $500,000 on line 19, following the Form 8824 instructions.
One building, two uses: the dwelling-unit line decides the split
If the business or rental use was inside the same dwelling unit, such as a home office, Reg. section 1.121-1(e) treats the whole property as your residence, and only post-1997 depreciation is carved out. If the rental part is a separate unit, such as a guesthouse, gain on that part is not excludable unless you also lived in it for two years.
In that case you allocate basis and price the same way you allocated depreciation, and the procedure's second example then excludes the home part and defers the separate unit's gain through an exchange. The instructions call for two worksheet Forms 8824, one for each portion.
Those mixed cases have their own pages: living in one side of a duplex and an ADU rented on your primary residence.
What to do before you list, and what changes if the replacement is a DST
Count the months. The five-year look-back moves with the sale date, so the window for doing both usually closes about three years after you move out; see how long you can rent your former home before losing the exclusion. Rent at a fair rate to an unrelated tenant, keep the lease and report the rental income.
Plan the replacement around the deferred gain, not the whole price. In the example, $700,000 of replacement property is enough. A Delaware Statutory Trust interest can be sized to that figure exactly and keeps the replacement as investment property, which matters because a replacement you later move into faces a five-year wait under section 121(d)(10); see moving into a 1031 replacement.
Related questions
Does the house have to be my home on the day I sell?
No. Section 121 asks about two of the five years before the sale, and the Form 8824 instructions say it 'doesn't require the property you gave up to be your principal residence on the sale or exchange date'.
Can I take the excluded amount in cash and still defer the rest?
Yes. Under Rev. Proc. 2005-14, cash counts as boot only to the extent it exceeds the gain excluded under section 121, so cash up to the excluded amount is not taxed.
Is the depreciation recapture deferred too?
Yes, if you exchange. The exclusion never covers post-May 6, 1997 depreciation, but section 1031 may defer it; see depreciation recapture on a former home.
Does it matter that I rented the house before I ever lived in it?
Yes. Rental periods after 2008 that come before your last use as a home are nonqualified use and shrink the exclusion; see how non-qualified use reduces the exclusion.
Which comes out ahead, the exclusion alone or both?
That depends on the size of the gain against the cap and on whether you want another property; the comparison is in section 121 versus 1031 for a former home.
Sources
Checked against these publications on September 30, 2026. Rules and figures change; confirm the current version with your CPA or attorney before you act. This page is general information, not tax or legal advice.
