Get your taxes done using TurboTax

I agree with the others  - only one exclusion every two years measured by the dates between the two sales. the sale of A is what it is. so you will owe taxes as if you never took the exclusion + plus interest and possibly penalties for late payment.  be careful, the gain will increase your income which besides directly increasing your taxes can have an effect on other items in your return.  the only real way to save taxes in your situation would be to wait the full two years after the sale of A to sell B.