capital gains tax

I got divorced and sold a second home in 2024.

Does my ex-wife and I both have to file the capital gains on our taxes or can just one of us?