It depends…Here are some things to consider:
If you sell your main residence – you can exclude up to $250,000 of the gain from your income ($500,000 if married filing a joint return).
To qualify for this exclusion, you need to meet ownership and use test. During a five-year period ending on the date of the sale, the homeowner must have owned the home and lived in it as their main residence for at least two years.
If you own two or more houses, you can only exclude the gains on the sale of your main residence. The gain on other houses is taxable income.
A loss on the sale of your main home is NOT deductible.