Do I need a 1031 exchange when selling my primary home to buy another?

So I've been going back and forth on this and can't get a straight answer. We've lived in our house for about 6 years, it's our main home, not a rental. We're selling it and buying a new primary residence right after. Someone at work told me I need to do a 1031 exchange to avoid taxes on the gain. But I've also heard there's some kind of exclusion for primary homes? I don't want to miss a deadline or mess up the paperwork on the sale. Our gain is going to be significant. Do I actually need a 1031 exchange when selling my primary home to buy another, or is there a different rule that applies here?

33 comments

Section 121 exclusion is what you're looking for, not a 1031 exchange. A 1031 is for investment or business property. Your primary residence has its own separate rule. If you've owned and lived in the home as your main home for at least 2 of the last 5 years before the sale, you can exclude a chunk of gain from income entirely. No exchange needed, no replacement property deadline, no qualified intermediary. The IRS instructions for Form 1040 and Publication 523 cover this in detail.

Lena K.

Author

This is what I was hoping to hear. So I don't have to find a replacement property within 45 days or anything like that?

Replacement property deadlines are strictly a 1031 thing. The Section 121 exclusion has no such requirement. You just need to meet the ownership and use tests on the sale itself.

Yeah your coworker had the wrong tool for the job. 1031 exchanges are for rental property, commercial property, investment land — stuff held for business or investment purposes. A house you've lived in as your main home for years isn't that. The Section 121 exclusion is specifically for primary residences and it's a much simpler path.

Lena K.

Author

That makes sense. I wish someone had just said that from the start.

Section 121 exclusion is the right answer here. The ownership and use tests are what matter: 2 years of ownership and 2 years of use as your main home within the 5 years before the sale. The exclusion amount depends on your filing status — the limits are in Publication 523 on irs.gov. I uploaded my closing disclosure and purchase agreement to taxr.ai last year when I sold, and it read through both documents and listed exactly which figures I'd need to fill out the gain worksheet. Saved me a lot of back and forth.

Lena K.

Author

Good to know it can actually work through the closing documents. Did anything unexpected come up?

Worksheet line for selling expenses was the one I almost missed. It flagged that commissions and title fees reduce your amount realized, which lowers the gain before the exclusion even applies.

One thing worth knowing: if you used part of your home as a rental or home office at some point, the calculation gets more complicated. Gain equal to any depreciation you claimed on the home after May 6, 1997 can't be excluded under Section 121, even if the rest of the gain is excluded. It's generally taxed as unrecaptured Section 1250 gain at up to 25%, and it's not sheltered by the exclusion.

Lena K.

Author

We've never rented any part of it and never claimed a home office, so I think we're clear on that.

Depreciation recapture then drops off the table entirely for you. Straightforward Section 121 situation.

The IRS simply doesn't allow a 1031 exchange on the home you live in. Section 1031 requires property held for productive use in a trade or business, or for investment. A home you live in doesn't qualify. People sometimes get confused because you CAN do a 1031 on a former primary home if it was later converted to a rental and held as such, but that's a very different situation.

Form 1099-S is what you'll probably receive from the closing agent after the sale. Even if your gain is fully excluded, you may still need to report the sale on Schedule D depending on the circumstances. If the closing agent asks you to certify the exclusion in writing before closing, that certification can sometimes eliminate the 1099-S filing requirement for them, but I'd check the instructions for Schedule D and Form 8949 carefully.

Lena K.

Author

Schedule D is what I need to look at for reporting the actual sale?

Form 8949 feeds into Schedule D. If your gain is fully excluded and you meet the requirements, you may not need to report it at all, but if you received a Form 1099-S you generally do need to report it and show the exclusion. The instructions walk through when reporting is required.

Form 8949 is where the sale actually gets reported if you do have to include it. You enter the sale price, your adjusted basis, any selling expenses, and then apply the Section 121 exclusion on that form. I had Taxr read through my HUD-1 settlement statement and it pulled out each line that affects basis or selling expenses and put them in order for me. Really helped me see which numbers went where before I touched the form. Worth doing if your closing docs are dense.

Lena K.

Author

My closing documents are definitely dense. Good idea to get them organized first.

The buying a new home part of your question doesn't affect the exclusion at all, by the way. Under current law you don't have to roll the proceeds into another home to get the exclusion. That was a rule that existed decades ago but it's gone. You could buy another home, rent an apartment, or put the money somewhere else entirely — doesn't matter for Section 121.

This trips people up constantly. The old rollover rule is long gone. The Section 121 exclusion stands on its own.

Married filing jointly or single makes a difference on the exclusion ceiling. The amounts differ by filing status and are spelled out in Publication 523. Worth pulling that up before you assume the full amount is available to you.

Lena K.

Author

We're married filing jointly, so I'll look up that limit in Publication 523.

Also worth checking: the 2-out-of-5-year window looks back from your sale date, not from when you bought. So if you've owned it 6 years but were away for a stretch — extended travel, job relocation, whatever — you want to count actual days you used it as your main home. The IRS counts short temporary absences as use days, but longer absences can be trickier.

Lena K.

Author

We've been here continuously the whole 6 years so that shouldn't be an issue, but good to flag for others.

Schedule D instructions and Publication 523 are both free on irs.gov and walk through the exclusion calculation step by step. I'd read the worksheet in Pub 523 before you do anything else. It shows the adjusted basis calculation, what counts as a selling expense, and how the exclusion gets applied in order.

Adjusted basis is the number people most often get wrong. You start with what you paid, add capital improvements over the years, and subtract any depreciation ever claimed. I had Taxr go through my purchase closing disclosure, a list of improvements I'd made, and my old returns, and it drafted a basis worksheet showing each addition and subtraction in order. I reviewed it, made one correction, and handed it to my CPA. Really clean way to go into that meeting.

Lena K.

Author

I have a folder of improvement receipts I've been keeping for years. Sounds like that's exactly what I need to pull together.

Improvement receipts are exactly right. New roof, HVAC, additions — those all increase basis. Routine repairs don't. Keeping them organized by year makes the worksheet much easier to build.

Worth noting: if you bought the home through a 1031 exchange at some point in the past, there's a special holding period rule under Section 121(d)(10) that affects eligibility. Doesn't sound like your situation, but it catches people who exchanged into a property and then moved in.

Publication 523 at irs.gov is the main reference document for all of this — the ownership test, the use test, the exclusion calculation, exceptions for partial exclusions if you didn't meet the full 2-year requirement. If you're doing this without a preparer, read it cover to cover first.

Partial exclusion section is important too — job change, health reason, or unforeseen circumstance can qualify you for a prorated exclusion even if you haven't hit the full 2 years.

If your gain is well under the exclusion ceiling for your filing status and you've lived there the whole time with no rental or office use, this is about as clean as a home sale gets. You may not even end up with a taxable number after the exclusion. Still worth going through the worksheet to confirm.

Lena K.

Author

That's reassuring. I'll work through Publication 523 and the Form 8949 instructions and see where the numbers land. Thanks everyone — this thread answered the question way better than anything else I'd found.

Qualified intermediary and the 45-day and 180-day rules are only relevant for a 1031. For a straight primary home sale under Section 121 you don't set up an exchange, you don't need a third-party intermediary, and you have no replacement timeline. The two rules exist in completely separate parts of the tax code for different situations.