You may qualify to exclude from your income all or part of any gain from the sale of your main home. To qualify, you must meet the ownership and use tests.
You can claim the exclusion if, during the 5 year period ending on the date of the sale, you have owned the home for at least 2 years (ownership test), and lived in the home as your main home for at least 2 years (use test).
You can exclude the entire gain on the sale of your main home up to $250,000 or $500,000 if all of the following are true. You are married and file a joint return for the year. Either you or your spouse meets the ownership test. Both you and your spouse meet the use test. And neither you nor your spouse excluded gain form the sale of another home within 2 years. If your home was transferred to you by your spouse (or former spouse if the transfer was incident to divorce), you are considered to have owned it during any period of time when your spouse owned it.
If you owned and lived in the property as your main home for less than 2 years, you may be able to claim a reduced exclusion. The maximum amount of gain you can exclude will be reduced if you did not meet the ownership and use tests due to a change in health, place of employment, or unforeseen circumstances. Unforeseen circumstances are considered if any of the following events occurred; an involuntary conversion of your home, natural or man-made disasters or war or terrorism, in the case of death, unemployment, divorce, multiple births resulting from the same pregnancy, or an event the IRS determined to be an unforeseen circumstance.
You cannot exclude gain on the sale of your home if, during the 2 years period ending on the date of the sale, you sold another home at a gain and excluded all or part of that gain. If you cannot exclude the gain, you must include it in your income. However, you can still claim a reduced exclusion, if the primary reason you sold the home was the same reason as above mentioned.