Here are the rules.
Section 152(d)(1) provides, in part, that to be a “qualifying relative” of a taxpayer, an individual must: (A) bear a certain relationship to the taxpayer, (B) have gross income for the calendar year that is less than the exemption
amount (as defined in section 151(d)), and (C) derive over one-half of his or her support for the calendar year from the taxpayer. In addition, section 152(d)(1)(D) requires that the individual not be a qualifying child of the taxpayer or of “any other taxpayer” for the taxable year. Section 152(d)(2)(H) provides that a qualifying relative may include an individual who has the same principal place of abode as the taxpayer and who is a member of the taxpayer’s household.
A supports as members of his household for the taxable year an unrelated friend, B, and her 3-year-old child, C. B has no gross income, is not required by section 6012 to file an income tax return, and does not file an income tax return for the taxable year. Accordingly, because B does not have a filing requirement and did not file an income tax return, C is not treated as a qualifying child of B or any other taxpayer, and A may claim both B and C as his qualifying relatives, provided all other requirements of sections 151 and 152 to qualify for the deduction are met.
Based on the example, the parties do not even have to be related to you. The question is whether they were a qualifying child of any other party. My guess is that one of the parents claimed them. You need to show that they resided with you and that you provided their support.