BobKamman
Level 15

It might be a lot easier to elect to be taxed as resident aliens for the entire year, and file a joint return.  Do they have children who would qualify for tax credits?  This might cost some SE tax, but for some people that's a great investment because it buys an additional year of SS coverage for a relatively small price.  From Pub 519:

If you are a dual-status alien, you can choose to be treated as a U.S. resident for the entire year if all of the following apply.
• You were a nonresident alien at the beginning of the year.
• You are a resident alien or U.S. citizen at the end of the year.
• You are married to a U.S. citizen or resident alien at the end of the year.
• Your spouse joins you in making the choice.
This includes situations in which both you and your spouse were nonresident aliens at the beginning of the tax year and both of you are resident aliens at the end of the tax year.