In some cases it is legal to not owe or pay taxes when you sell your primary residence. Here is how it works:
“Let’s start from the very beginning, a very good place to start”.
The first issue is to know the "basis" of your home. Your original cost basis is the amount of money you paid for your home. But during the time period you owned and lived in your home, the original cost basis can be adjusted up or down dependent on things like capital improvements to the home, depreciation, or damage that causes a reduction in value.
When you sell your home, you can have a gain or a loss, but how the IRS views that gain or loss can vary. For now think of it like buying a stock and holding onto it for a number of years before selling it. And then, upon the sale you either made money or lost money.
To determine if you have a gain or a loss, know that your basis is the beginning point for gain or loss calculation. Then take into consideration the amount for which you sell the property.
For the sake of this story let’s assume the only thing affecting the value of your home is appreciation. Therefore, the capital gain on your home sale is the difference between the sale price and what you originally paid for the home. If you have owned and lived in your home for many years, that capital gain may be a significant amount.
121 Exclusion: The IRS says in most cases up to $250,000 in capital gains ($500,000 for a married couple) is exempt or tax-free provided the home was your principal residence for two out of five years prior to the sale.
Be aware, however, that this exclusion does not apply to investment properties (rentals), second homes, when a home or a partial interest in a home has been gifted to you, or for joint ownership with children, or real estate inheritances.
In the case of an inheritance, however, there is another tax allowance and that is you are able to claim "stepped-up basis". This means your basis for the inherited home is “stepped up” to the market value of that home on the date you received it. The capital gain when you sell it is then calculated using your stepped-up value vs. the original basis, and this could save you thousands of dollars in taxes. Note that this is also true of inherited stocks, bonds, ETF’s or mutual funds. Keep in mind we are only focusing on capital gains tax here as other taxes may apply, but that is an entirely different story!
Because tax code changes every year, many taxpayers are unaware of how the step-up in basis works, and wind up gifting their home to their heirs or change to joint ownership with their heirs assuming they are saving on estate, capital gains and inheritance taxes. But doing this could present their heirs with a large tax liability upon sale.
There are also situations where the step-up in basis is not straightforward, for instance when one spouse passes away, and the home is held in joint tenancy with right of survivorship. In this situation the surviving spouse receives a half-step-up in basis, based on the fifty-percent of the home that the deceased spouse owned.
When “gifting” occurs there are many considerations such as the gift tax implications (again a story for another day) and the loss of stepped up basis. How you calculate the basis of gifted property depends on whether there will be a gain or a loss.
For determining gain, the gifted basis is the same as that of the original owner and this is known as “carryover” basis. It is for this reason that planners suggest holding onto a highly appreciated asset and bequeathing it instead of gifting it. This choice could save your heirs thousands of tax dollars.
When a gifted asset loses or depreciates in value to less than the donor’s original cost, the recipient’s basis is the fair market value (FMV) of the asset at the time of the gift. So say a donor paid $100 for some stocks that he or she then gifts and when the gift occurs the shares are worth $50. By the time the recipient sells the shares they are only worth $25. Here is how that loss would be calculated:
$50 (FMV at gifting) -$25 (sale price) = $25 loss
Using the same original donor basis of $100, if the value of the asset had appreciated and was $200 when gifted but dropped to $50 when the recipient sells it, you would calculate loss this way:
$100 (donor basis) - $50 (sale price) = $50 loss
While we suggest keeping in mind 121 exclusions, stepped-up basis and gifting vs. bequeathing when considering the disposition of your home, or any asset, we realize that other factors may influence your specific situation. Therefore, always make an informed decision. It is best to consult with a professional before “winging it”.
 Depreciation is a reduction in the value of an asset over time, due typically to wear and tear and it is an indication of how much of an asset’s value has been used up; in general this applies only when the a tangible asset (in this case your home) has been used for business or rental purposes.
 Although the IRS may exempt or realize some or all of the gain, you cannot take a loss on the sale of a primary residence.
 Rental or other business properties, vacation homes, and part rentals are subject to an entirely different set of rules and taxes, potentially including a tax on “depreciation recapture”.
 Gifting occurs when an asset is transferred to another while the original owner is still alive; a bequest is when an asset is transferred to someone else postmortem, and this is known as an inheritance.