https://www.irs.gov/pub/irs-pdf/p501.pdf

Criteria for Widow/Widower with Dependent Child Status

Four criteria exist for being able to claim this filing status:

  1. The taxpayer was eligible to file a joint return with his or her spouse for the year during which the spouse died, regardless of whether a joint return was actually filed.

  2. The taxpayer's spouse died during either of the two immediately preceding tax years.

  3. The taxpayer has not remarried during the current tax year.

  4. The taxpayer maintains a home for at least one dependent child who is a son, daughter, stepson or stepdaughter by blood or through adoption. This dependent must reside with the taxpayer for the entire tax year except for temporary absences such as living away at school for a period of time during the year.

How the Two-Year Rule Works

Suppose a spouse passes away in 2019. The surviving spouse can file a joint return with her deceased spouse for the year of his death, which would be 2019. The surviving spouse can then file using the qualifying widow/widower status for tax years 2020 and 2021 if she qualifies.

Types of Dependents 

The surviving spouse must be eligible to claim his or her son, daughter, stepson, or stepdaughter as a dependent in each of these qualifying years. This is true whether the child is related by blood or adoption. Foster children are not included in the definition, nor are any other types of dependents, but that doesn't mean the surviving spouse can't claim them as dependents for other tax purposes. This rule for dependents only pertains to the qualifying widow/widower filing status.

Maintaining a Home for a Dependent Child

The taxpayer must also maintain a home for her son, daughter, stepson, or stepdaughter. Maintaining a home means that the taxpayer furnished more than half the cost of keeping up the home during the tax year.

Costs of keeping up a home include rent or mortgage payments, property taxes, utilities, and groceries.

The child must reside in the same household as the taxpayer for the entire year except for "temporary absences," which include illness, education, business, vacation, or military service. These events won't disqualify the taxpayer for qualifying widow/widower status as long as it's "reasonable to assume the absent person will return to the home after the temporary absence. You must continue to keep up the home during the absence," according to IRS Publication 501.