Talk to a tax professional.
My understanding is that if you were to sell in the tax year that she passes, you would still be married filing jointly. You don’t go to single until the next tax year.
But talk to a tax professional, which I certainly am not.
It is also my understanding that the capitol gains threshold is 500k of increase over what you paid for the house.
We sold my dad’s house after he passed and his ‘gain’ in value was below the threshold even though the sale price was over the threshold.