The expemption is only for your ‘main home’ which means the home you currently live in.
You can claim exemptions if you have owned the home for at least 2 years and if you have resided in the home for at least 2 of the previous 5 years (from the date of the sale) - this passes both the Ownership and Use test.
The exemption is $250,000 for single or $500,000 for married couples.
You cannot deduct any losses on your personal home however.