Ask a Lawyer and Get Answers to Your Legal Questions
"You can exclude up to $250,000 of the gain on the sale of your main home if all of the following are true.
To claim the exclusion, you must meet the ownership and use tests. This means that during the 5-year period ending on the date of the sale, you must have:
You meet the ownership test. = Owned the home for at least 2 years.
You meet the use test. = Lived in the home as your main home for at least 2 years
During the 2-year period ending on the date of the sale, you did not exclude gain from the sale of another home.
If you and another person owned the home jointly but file separate returns, each of you can exclude up to $250,000 of gain from the sale of your interest in the home if each of you meets the three conditions just listed.
You may be able to exclude up to $500,000 of the gain on the sale of your main home if you are married and file a joint return and meet the requirements listed in the discussion of the special rules for joint returns, later, under Married Persons. "
cited from the IRS.