This article by Michael Kitces comprehensively addresses the first part of your question. To summarize, your plan could work, but there are the following limitations:
capital gains exclusion shall not apply to any gains attributable to depreciation since May 6, 1997 (the date the rule was enacted), ensuring that the depreciation recapture will still be taxed (at a maximum rate of 25%)
capital gains exclusion is specifically available only for periods during which the property was actually used as a primary residence; any other time (since January 1st, 2009) that the property was not used as a primary residence is deemed “nonqualifying use”. Accordingly, to the extent gains are allocable to periods of nonqualifying use (gains are assumed to be pro-rata over the holding period), those gains are not eligible for the exclusion
capital gains exclusion on a primary residence that was previously part of a 1031 exchange is only available if the property has been held for 5 years since the exchange
As to the second part of the question, it looks like there is a “same taxpayer” rule for 1031 exchanges, so whoever is on the title needs to match between the old and new property. However, both spouses do not need to be on the title to claim the Section 121 exclusion (IRS link; my emphasis added):
You can exclude up to $500,000 of the gain on the sale of your main home if all of the following are true.
- You are married and file a joint return for the year.
- Either you or your spouse meets the ownership test.
- Both you and your spouse meet the use test.
So you could hypothetically keep just your wife on the title of both the old and new property, but still use the Section 121 exclusion, albeit limited as detailed in the Kitces article.