Big River,
One good source for information on this is the IRS Publication 523.
http://www.irs.gov/publications/p523/ar02.html
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:
Owned the home for at least 2 years (the ownership test), and
Lived in the home as your main home for at least 2 years (the use test).
Exception. [i]If you owned and lived in the property as your main home for less than 2 years, you can still claim an exclusion in some cases. The maximum amount you can exclude will be reduced.[/i]
Reduced Maximum Exclusion:
You can claim an exclusion, but the maximum amount of gain you can exclude will be reduced if either of the following is true.
You did not meet the ownership and use tests, but the reason you sold the home was:
A change in place of employment,
Health, or
Unforeseen circumstances (as defined later).
Your exclusion would have been disallowed because of the rule described in More Than One Home Sold During 2-Year Period, later, except that the reason you sold the home was:
A change in place of employment,
Health, or
Unforeseen circumstances (as defined later).
Unforeseen Circumstances
The sale of your main home is because of an unforeseen circumstance if your primary reason for the sale is the occurrence of an event that you could not reasonably have anticipated before buying and occupying your main home. You are not considered to have an unforeseen circumstance if you sold your home after August 12, 2004, and the primary reason you sold it was that you preferred to get a different home or your finances improved.