Those who lose a spouse during that tax year can file a joint return for the tax year of their spouse’s death. But for the next two years those who have a dependent and remain unmarried can file as a qualifying widow(er) with a dependent child. After that you must either file as single or head of household.
The benefit of filing as a qualifying widow(er) with dependent child is that you get the same preferential standard deduction and tax rates as married couples who file jointly.
You can file as a qualifying widow(er) with dependent child if
you were entitled to file a joint return the year your spouse died
your spouse died during one of the previous two tax years and you did not remarry
you can claim an exemption for a child or stepchild
the child lives in your home all year
you paid for over half the cost of keeping up a home