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.
Note.
If you are single at the end of the year, you cannot make this choice.