Owner questions

Selling a Duplex You Live In: Section 121 and a 1031 Together

Live in one side of a duplex and rent the other? The sale is usually split: home sale exclusion on your unit, 1031 deferral on the rental. How the IRS allocates it.

Published October 27, 2026 | Last reviewed October 2026

Short answer: when you live in one unit of a duplex and rent the other, the tax code usually treats the sale as two properties. The unit you live in can qualify for the home sale exclusion under Section 121 if you meet the ownership and use tests. The rented unit is investment property, and its share of the gain can be deferred with a 1031 exchange. IRS Revenue Procedure 2005-14 shows how both rules can apply to a single sale.

Owner-occupied duplexes are a common first investment around Sacramento. You live in one side, a tenant covers part of the mortgage, and years later the property has appreciated. When it is time to sell, the question is not "1031 or home sale exclusion." It is how much of the gain belongs to each.

Why a duplex is split in two

The Section 121 regulations draw the line at the dwelling unit. Under Treasury Regulation 1.121-1(e), Section 121 does not apply to the gain allocable to any portion of the property, separate from the dwelling unit, that you did not use as your residence. If home and business use are inside the same dwelling unit, no allocation is required. A duplex is two dwelling units, so the side you rented is outside your home for this purpose.

IRS Publication 523 says the same thing in plainer words: if part of the property was used as a residence and another part, separate from the dwelling unit, was used for nonresidential purposes, only the gain allocable to the residential part is excludable.

The rental side has its own path. Section 1031(a) defers gain on real property held for productive use in a trade or business or for investment when it is exchanged for like-kind real property held the same way. The unit you rented to tenants fits that description. The unit you lived in, on its own, does not.

How Rev. Proc. 2005-14 handles it

Rev. Proc. 2005-14 addresses a single exchange where Section 121 and Section 1031 both apply. Its second example is the closest IRS illustration to a duplex. The owner had two separate dwelling units on one property, a house used as a principal residence and a guesthouse used for business. The owner allocated basis by square footage, then exchanged the whole property for a new residence plus a separate business property of equal value to the business portion given up.

The result in that example:

Swap "guesthouse used as an office" for "unit rented to a tenant" and you have the basic duplex question.

The allocation step

The split is not a guess. Regulation 1.121-1(e)(3) requires you to allocate both the basis and the amount realized between the residential and nonresidential portions using the same method you used to figure depreciation, if you claimed any. Rev. Proc. 2005-14 notes that allocation by square footage is an appropriate method. By square footage, two units of equal size would split evenly, but the method you used on your returns controls.

IRS Publication 527 uses a duplex as its example of renting part of a property. It explains that shared costs such as mortgage interest and real estate taxes are divided between the rental part and the personal part, as though you owned two separate properties. The same logic carries through to the sale.

Your unit: the home sale exclusion

The rental unit: the 1031 side

Three common duplex scenarios

You still live in one unit when you sell

This is the split described above. Your unit is tested under Section 121. The rental unit can go into a 1031 exchange. Escrow and your intermediary need to know at the start that only part of the proceeds is exchange money.

You moved out and rented both units

Now both units are rentals at the time of sale, and the whole property may be held for investment. Your former unit may still pass the 2 out of 5 year test if you moved out recently enough. That timing question is covered in lived in it, then rented it.

You want to move into the replacement

Section 1031 requires the replacement to be held for investment or business use. A unit you plan to live in does not meet that description on its face. If the plan is to buy another duplex and occupy one side, have your CPA review how the replacement value is allocated before you sign.

Before you list

If you are still deciding whether to sell, keep or sell walks through the tradeoffs. For the California side of the bill, see California taxes when selling a rental. To find an intermediary or CPA, you can request a referral.

Common questions

Can I use a 1031 exchange if I live in one unit of my duplex?

Usually for the rented unit, yes. The unit held for investment can be exchanged under Section 1031. The unit you live in is a personal residence and is handled under the Section 121 home sale exclusion instead.

How is the gain split between my unit and the rental unit?

Treasury Regulation 1.121-1(e)(3) requires you to allocate basis and sale price using the same method you used for depreciation. Rev. Proc. 2005-14 says square footage is an appropriate method.

Can I exclude gain on the rental side of my duplex?

Generally no. The rented unit is a separate dwelling unit, and Section 121 does not apply to gain on a separate portion you did not use as your residence. A 1031 exchange may defer that gain instead.

Does depreciation on the rental unit get taxed when I sell?

If the rental unit's share goes through a completed 1031 exchange, the gain, including depreciation, is deferred. Depreciation claimed on your own unit after May 6, 1997 cannot be excluded under Section 121.

Next step. Request a referral to a local qualified intermediary, CPA or advisor.

Sources

  1. IRS, Internal Revenue Bulletin 2005-7, Rev. Proc. 2005-14
  2. 26 CFR 1.121-1, Exclusion of gain from sale or exchange of a principal residence
  3. 26 U.S. Code Section 121
  4. 26 U.S. Code Section 1031
  5. IRS Publication 523, Selling Your Home
  6. IRS Publication 527, Residential Rental Property

Sources checked October 27, 2026. Last reviewed October 2026.

General information only, not tax or legal advice. Consult a CPA or tax attorney.