How to claim double tax breaks when selling two homes

Couple must convert beach house into primary home