Selling Your Main Home: What to Know Before You Assume the Gain Is Tax-Free

Selling Your Main Home: What to Know Before You Assume the Gain Is Tax-Free

Apr 23, 2026

Bjorn Swanson

Bjorn Swanson

Bjorn Swanson

For a lot of people, selling a main home feels like it should be simple. 

You sell the house, pay off what needs paid off, and move on. 

And sometimes, from a tax perspective, it is fairly simple. 

But this is also one of the easiest places for people to make the wrong assumption. People hear that the gain on a home sale is “tax free,” skip over the details, and assume there is nothing to think about. 

Sometimes that works out. 

Sometimes it doesn’t. 


Start with this: sale price is not the same as gain 

One of the most common mistakes in a home sale is assuming the tax result is based on what the house sold for. 

It isn’t. 

The starting point is usually your gain, not your sale price. 

Very generally, that means looking at: 

  • what you sold the home for 

  • minus certain selling costs 

  • compared against your basis in the home 


That is where the tax conversation starts. 


Basis matters more than people think 

Your basis is usually the starting point for what you have invested in the property for tax purposes. 

For many homeowners, that starts with what they originally paid for the home. But it does not stop there. 

Basis can also be affected by: 

  • certain closing costs from when you bought it 

  • major improvements you made over time 

  • and, in some situations, other adjustments that changed your investment in the property 


That is why one of the best records to keep is your original settlement statement from when you bought the home. 

If you still have that, keep it. 

If you do not, and the sale is not done yet, it may be worth tracking it down. 


Improvements can matter too 

Another part of basis that often gets overlooked is the money you put into improving the home over the years. 

Not everything you spend on a house helps you here. But some things do. 

In general, larger capital improvements are more likely to increase basis. 

That can include things like: 

  • an addition 

  • a major kitchen remodel 

  • a bathroom remodel 

  • a new roof 

  • major window replacement 

  • HVAC replacement 

  • a garage addition 

  • major plumbing or electrical upgrades 

  • permanent landscaping or hardscaping 


Those kinds of items may increase what you have invested in the property, which can reduce your gain. 


Repairs and maintenance are usually different 

This is where homeowners often blur the lines. 

Some costs may increase your basis. Others usually will not. 

In general, larger capital improvements are more likely to help your basis. Routine repairs and maintenance usually do not. 

That sounds simple, but in real life it can be a gray area. 

A major remodel, addition, or system replacement is easier to spot. Smaller items are not always as clear—especially when a cost is part of a larger project. 

That is one reason I like to defer back to IRS guidance here rather than pretend every item fits neatly into a simple list. 

If you want to dig deeper, two good places to start are: 

  • IRS Publication 523, Selling Your Home 

  • IRS Publication 551, Basis of Assets 


As a practical rule, keep the records on bigger projects and ask questions before assuming something counts. In gray areas, good documentation and a timely tax conversation matter more than trying to force a confident answer too early. 


Selling costs matter too 

Another place people leave money on the table is forgetting that the cost of selling the home can matter. 

Depending on the facts, selling expenses may reduce the amount realized on the sale. 

That can include things like: 

  • realtor commissions 

  • certain closing costs 

  • other direct selling expenses 


So before you jump from “we sold it for X” to “our gain must be Y,” it is worth slowing down and looking at the full picture. 


The important distinction: gain is not always the same as taxable gain 

This is where people often get tripped up. 

Even if you have a gain on the sale of your home, that does not automatically mean the full gain is taxable. 

And that is where Section 121 comes in. 

If the home was your principal residence and you meet the rules, Section 121 may allow you to exclude up to: 

  • $250,000 of gain if you are single 

  • $500,000 of gain if you are married filing jointly 


That is a big deal. 

But the key point is this: 


You do not start with the exclusion. You start by figuring out the gain correctly. 

Then you determine how much of that gain may be excluded. 


Who may qualify for the exclusion 

At a basic level, Section 121 usually looks at whether: 

  • you owned the home for at least 2 years during the 5-year period before the sale 

  • you used it as your main home for at least 2 years during that same 5-year period 


For married couples filing jointly, there are added rules around ownership, use, and whether either spouse used the exclusion too recently. 

This is one reason a home sale that feels simple can still deserve a quick tax review. 


It is not always all or nothing 

Some sellers do not meet the full timing rules but may still qualify for a partial exclusion if the move was tied primarily to: 

  • work 

  • health 

  • certain unforeseen circumstances 


That does not apply in every case, but it matters because many people assume they either qualify fully or not at all. 

That is not always true. 


Where people get surprised 

The surprises usually come from one of two places: 

First, the gain was larger than expected because basis was not tracked well. 

Second, the seller assumed the exclusion applied automatically, when the facts were more complicated. 

That can happen when: 

  • the home was converted to a rental 

  • the seller split time between multiple homes 

  • the property had mixed personal and business use 

  • the seller moved out earlier than expected 

  • records for improvements were never kept 


How this can overlap with other planning 

Most principal residence sales stop with Section 121. 

But not all of them. 


Section 121 and installment sales 

A principal residence sale can sometimes involve owner financing or another structure that uses the installment method

When that happens, the tax conversation gets more layered. 


Section 121 may still allow part of the gain to be excluded. But if the sale is being reported under the installment method, that exclusion has to be factored into the calculation that determines the gross profit percentage—the percentage of each principal payment that is treated as taxable gain over time. 

In other words, the exclusion does not just sit off to the side. It affects the math. 

That matters because sellers sometimes assume the Section 121 exclusion will automatically absorb the entire front end of the deal, including a large down payment. In practice, it does not always work that cleanly unless the transaction is structured with that in mind. 

So even when Section 121 applies, the timing of gain recognition under an installment sale can still create planning questions: 

  • how the exclusion is applied in the gross profit calculation 

  • how much of each principal payment is treated as gain 

  • whether a larger down payment creates earlier tax friction than expected 

  • and whether the structure of the deal is really accomplishing what the seller thought it would 


This is one of those areas where small details in the structure can change the result in a meaningful way. 

If you are selling a principal residence and carrying the contract, it is worth having that tax conversation before the terms are finalized—not after the note is signed and the down payment is already set. 


Section 121 and 1031 exchanges 

A standard 1031 exchange generally applies to investment or business property, not a typical principal residence. 

But in the real world, some properties are not purely one thing or the other. 

A good example is a farm or ranch property that includes both: 

  • a main home and farmstead 

  • and production acreage held for business or investment use 


In the right situation, those pieces may not be treated the same way for tax purposes. 

That can open the door to a planning conversation where: 

  • Section 121 may apply to the home and farmstead 

  • while a 1031 exchange may apply to the production acreage 


That does not happen automatically, and it is not something to sort out after the fact. 

If that kind of split may matter, the conversation needs to happen before the contract is finalized, while there is still time to think through how the property is being sold, how values are being allocated, and what documentation should be gathered. 

In some cases, that may also mean bringing in a third-party valuation to help support the value of the farmstead tied to the Section 121 exclusion. 

The goal is not to force a split where one does not exist. The goal is to make sure the tax treatment matches the actual facts of the property—and that the support for it is in place before closing. 


What to keep if a sale may be coming 

If you are thinking about selling your home, try to keep: 

  • your original closing statement 

  • records of major improvements 

  • invoices and proof of payment 

  • sale closing documents 

  • notes on when the property was used as your main home 

  • records of any rental or business use, if that applies 


You do not need perfect records. 

But better records usually lead to a clearer tax answer. 


The takeaway 

If you are selling your main home, the question is not just: 


“What did it sell for?” 

The better questions are: 

  • What is my basis? 

  • What selling costs matter? 

  • What is the actual gain? 

  • How much of that gain may be excluded? 

  • Are there any complications because of timing, rental use, or how the sale is structured? 


That is the difference between hearing “home sales are tax free” and actually knowing whether that is true in your situation. 

For many sellers, Section 121 is a valuable break. 

But the best way to use it well is not to assume it is automatic. 

It is to slow down, get the numbers right, and ask the right questions before the sale is done. 

CTA image

Montana Roots. Future Focused.

From taxes to insurance, we help Montana families, farms, and businesses protect what they’ve built and plan for what’s next.

CTA image

Montana Roots. Future Focused.

From taxes to insurance, we help Montana families, farms, and businesses protect what they’ve built and plan for what’s next.

CTA image

Montana Roots. Future Focused.

From taxes to insurance, we help Montana families, farms, and businesses protect what they’ve built and plan for what’s next.