Either you or your spouse meets the ownership test.
This chapter explains the tax rules that apply when you sell your main home. David's 5-year test period consists of the 5 years before he went on qualifying official extended duty. To claim the exclusion, you must meet the ownership and use tests. If you qualify for an exclusion, show it on the line directly below the line on which you report the gain. Real estate taxes have long been the bane of retirees, especially those with modest incomes.
Either you or your spouse meets the ownership test.