What you select on the W-4 that you give to your employer for your status and the number of allowances claimed for income tax withholding is not relevant on how you file your tax return.
If you are legally married as of 12/31/2017 you can only file your 2017 tax return as either Married Filing Jointly or Married Filing Separately. If your spouse is an illegal they can still get a Individual Tax Identification Number from the IRS to be used on a tax return in lieu of a Social Security number by completing a Form W-7.
See this IRS website for information on an ITIN - https://www.irs.gov/individuals/international-taxpayers/general-itin-information