You are eligible to file your return as a qualifying widow(er) with dependent child if you meet all of the following tests.
You were entitled to file a joint return with your spouse for the year your spouse died. It does not matter whether you actually filed a joint return.
Your spouse died no more than two years before the year for which you are filing your return and you did not remarry before the end of the year for which you are filing your return.
You have a child or stepchild whom you can claim as a dependent. This does not include a foster child.
This child lived in your home all year, except for temporary absences. There are also exceptions for a child who was born or died during the year and for a kidnapped child.
You paid more than half the cost of keeping up a home for the year.
For more information see
IRS Publication 501