You are considered unmarried for the whole year if, on the last day of your tax year, you are unmarried or legally separated from your spouse under a divorce or separate maintenance decree. State law governs whether you are married or legally separated under a divorce or separate maintenance decree.
See IRS Publication 17 Your Federal Income Tax (For Individuals) for more information.