You can take the gain exclusion as long as you considered the home your "primary residence" for 2 of the last 5 years. If you have a capital gain from the sale of your main home, you may qualify to exclude up to $250,000, if you file single or $500,000 if you file married jointly of that gain from your income.