SSN and child tax

Hello,

my wife and my daughter came to USA in December 2017 legally. Anyway something happened and they became illegal people in May 2018. By the way,  They had no SSN  They have lived with me so far and They became legal in May 2024. They have SSN right now. I want to ask you something. Can I get child tax credit by adding them to the amendment form with these SSN numbers for the years 2018-2023? Thank you so much.