Per IRS Publication 17 Your Federal Income Tax (For Individuals), page 21:
Nonresident alien or dual-status alien. Generally, a married couple can't file a joint return if either one is a nonresident alien at any time during the tax year. However, if one spouse was a nonresident alien or dual-status alien who was married to a U.S. citizen or resident alien at the end of the year, the spouses can choose to file a joint return. If you do file a joint return, you and your spouse are both treated as U.S. residents for the entire tax year. See chapter 1 of Pub. 519.
Per
IRS Publication 519 U.S. Tax Guide for Aliens, page 9:
Nonresident Spouse Treated as a ResidentIf, at the end of your tax year, you are married and one spouse is a U.S. citizen or a resident alien and the other spouse is a nonresident alien, you can choose to treat the nonresident spouse as a U.S. resident. This includes situations in which one spouse is a nonresident alien at the beginning of the tax year, but a resident alien at the end of the year, and the other spouse is a nonresident alien at the end of the year.
If you make this choice, you and your spouse are treated for income tax purposes as residents for your entire tax year. Neither you nor your spouse can claim under any tax treaty not to be a U.S. resident. You are both taxed on worldwide income. You must file a joint income tax return for the year you make the choice, but you and your spouse can file joint or separate returns in later years.
How To Make the ChoiceAttach a statement, signed by both spouses, to your joint return for the first tax year for which the choice applies. It should contain the following information.
- A declaration that one spouse was a nonresident alien and the other spouse a U.S. citizen or resident alien on the last day of your tax year, and that you choose to be treated as U.S. residents for the entire tax year.
- The name, address, and identification number of each spouse (If one spouse died, include the name and address of the person making the choice for the deceased spouse.)
Additional information available in this section of IRS Publication 519:
*Suspending the Choice
*Ending the Choice
*Special Situations
IRS Publication 54 Tax Guide for U.S. Citizens and Resident Aliens Abroad, page 7 outlines how to obtain a Social Security Number (SSN) or an Individual Taxpayer Identification Number (ITIN) for the nonresident alien spouse chosen to be treated as a U.S. resident.
To indicate that you would like to treat your nonresident alien spouse as a resident alien for purposes of electronically filing your return:
- From within your TaxAct® return (Online or Desktop), click Federal. On smaller devices, click the menu icon in the upper left-hand corner, then select Federal
- Click Miscellaneous Topics to expand the category and then click Nonresident Alien Spouse Election
- Check the box to indicate that you wish to treat your spouse as a resident alien
- In the filing steps, you will be prompted to attach a PDF of the signed statement electing to treat the nonresident alien spouse as a resident alien