Yes you will need to attach a statement to your return if your spouse was a nonresident alien at the beginning of 2018. If your spouse was a resident alien for all of 2018, no statement is needed.
You can find information on the statement on page 8 of Publication 519. You will need to print your return, attach the statement and mail to the IRS.
Publication 519
Making the choice. You should attach a statement signed by both spouses to your joint re-turn for the year of the choice. The statement must contain the following information.
• A declaration that you both qualify to make the choice and that you choose to be treated as U.S. residents for the entire tax year.
• The name, address, and taxpayer identification number (SSN or ITIN) of each spouse.