There is a tax rule that may allow you to exclude profit from the sale of your primary residence — the home sale exclusion rule under IRS section 121. If certain requirements are met, some or all of the gain may not be taxed. Here is how that works.
The home must be your principal residence
The rule applies only when you sell the home that served as your main place of living, or your principal residence. It is the property you actually live in most of the time, rather than a home held mainly as a rental or investment. If the property was mainly used to generate rental income or held for investment purposes, the exclusion generally does not apply.
You must have owned and lived in the home long enough
The law also looks at how long you owned and lived in the property before selling it. In most situations, you must have owned the home for at least two years and used it as your principal residence for at least two years during the five years before the sale. The time you owned the home and the time you lived in it do not have to overlap, but both must fall within that five-year period.
Only part of the gain can be excluded
The exclusion protects gains only up to certain limits. If you file taxes as a single homeowner, you can generally exclude up to $250,000 of profit from the sale. Married couples filing jointly may exclude up to $500,000. If the gain from the sale exceeds those amounts, the portion above the limit may still be subject to capital gains tax.
You can lose the exclusion in certain situations
The exclusion is not available in every home sale. For example, you generally cannot use the rule if you already claimed the home sale exclusion on another property within the previous two years. In addition, if the profit from the sale goes beyond the exclusion limits, the remaining gain may still be taxable even though part of the sale qualifies for the exclusion.
Before you sell
If you expect a large gain, it helps to review the rules before listing the property. Small details about how long you lived in the home or how the property was used can affect whether the exclusion applies. Taking a closer look at your situation before the sale can help you avoid unexpected tax consequences later.

