Deductions & credits

You  marry  spouse thus  your spouse's children are your step children or in IRS terms your child due to the marriage.

 

This child (step) had kids ... those kids are your grandchildren (not step) due to the marriage to spouse ... this holds even if you divorce the spouse.  

 

Hence they do qualify since they are a descendant  of your IRS child.