If you are a US Resident, then yes, you can file a joint return with your spouse. By doing so, your spouse is choosing to be treated as a US Resident for tax purposes. If your spouse chooses to be treated as an US resident for tax purposes, and you want to file as Married Filing Joint, you can apply for an ITIN when you file your return. You would need to include their income FROM ALL SOURCES WORLDWIDE (not just what they earned in the US) on your return as well and they would be taxed on it. If you choose filing jointly, you will need to print and mail your return along with the W-7 which is an application for an ITIN and any other required documents to the address in the instructions
If they do not have an SSN or ITIN and you choose to file Married Filing Separate ,you can enter spouses name and DOB and then on the next screen you can select "xxx is a non resident alien or dual status spouse" Make sure you put a check mark in the box that says My spouse is a Non-Resident alien in the My info section. When you get to the end and try to transmit the return, ignore the e-file errors regarding your NRA spouse and select transmit your return. If that does not work you will need to print and mail your return and write NRA (Non Resident Alien) in the space for her SSN.
When did you meet the substantial presence test? If you did not meet it until after the beginning of 2024, you would be considered a dual status alien and you would also still need to file a 1040NR which can be done through our partner Sprintax.com
How should I file my taxes if my spouse is a nonresident alien?