The definition of a child is single and under 21, before filing I-526 petition.
"Child" is defined by the law for immigration purposes. It is complex and found at INA 101(b) and (c). For Immigrant Visa purposes (b) describes numerous specific types of children (in wedlock, out-of-wedlock, legitimated, acknowledged, bona fide unlegitimated, step, adopted) and it gets more complex for derivative citizenship and then there is the thing asked about here: the CSPA.
The Child Status Protection Act (CSPA) has a series complex calculations that MIGHT preserve eligibility for an Immigrant Visa after reaching the 21st birthday but in all cases the visa petition (I-526 for EB-5) MUST be filed while the dependent child is under 21 and unmarried. IF CSPA could apply to your kid, see a lawyer.
Under the EB-5 visa program requirements, the child must be under the age of 21 at the time of filing the I-526 petition. Once the petition is filed, the child's age will be "frozen".