Final answer:
Mary and John can file a joint return and potentially exclude up to $500,000 of the gain from the sale of their principal residence under Section 121 exclusion, as Mary meets the ownership test and both meet the use test, with John having never used the exclusion before.
Step-by-step explanation:
The availability of the Section 121 exclusion depends on various eligibility criteria, one of which is the ownership and use test. To qualify for the full exclusion, a taxpayer must have owned and used the residence as a principal residence for at least two out of the five years preceding the sale.
Since Mary has owned and used her residence for over six years, she meets this requirement. However, for a married couple filing jointly to exclude up to $500,000 of the gain (instead of the $250,000 exclusion limit for single filers), each spouse must meet the use test, and at least one spouse must meet the ownership test.
John, having lived in the residence for the past two years, satisfies the use test, but he does not need to meet the ownership test requirement because Mary, his spouse, meets it. Additionally, because John has never used the Section 121 exclusion, the couple is not disqualified by the rule that forbids using the exclusion more than once every two years.
Consequently, Mary and John can file a joint return and potentially exclude up to $500,000 of the gain from the sale of their principal residence under Section 121 exclusion.