One of the eligibility requirements for the child and dependent care credit states that the childcare must be provided so you (and your spouse if filing jointly) could work or look for work. However, if your spouse did not have a job and had no earned income, you still may take the credit if he or she was a full-time student or disabled.
Per IRS Instructions for Form 2441 Child and Dependent Care Expenses, page 4:
Line 5 - If You or Your Spouse Was a Student or Disabled.
Your spouse's earned income. Your spouse was a full-time student if he or she was enrolled as a full-time student at a school for some part of each of 5 calendar months during 2019. The months need not be consecutive. A school doesn't include an on-the-job training course, a correspondence school, or a school offering courses only through the Internet. Your spouse was disabled if he or she wasn't physically or mentally capable of self-care. Figure your spouse's earned income on a monthly basis.
For each month or part of a month your spouse was a student or was disabled, he or she is considered to have worked and earned income. His or her earned income for each month is considered to be at least $250 ($500 if more than one qualifying person was cared for in 2019). Enter that amount on line 5. If your spouse also worked during that month, use the higher of $250 (or $500) or his or her actual earned income for that month.
To enter these amounts in TaxAct®: