For purposes of paragraph (1)(B)(ii), a child meets the requirements of this paragraph if—
(i)
in the case of a child who is not an applicable child for the fiscal year (as defined in subsection (e)), the child—
(I)
(aa)
(AA)
was removed from the home of a relative specified in
section 606(a) of this title (as in effect on
July 16, 1996) and placed in foster care in accordance with a voluntary placement agreement with respect to which Federal payments are provided under
section 674 of this title (or
section 603 of this title, as such section was in effect on
July 16, 1996), or in accordance with a judicial determination to the effect that continuation in the home would be contrary to the welfare of the child; and
(BB)
met the requirements of
section 672(a)(3) of this title with respect to the home referred to in subitem (AA) of this item;
(bb)
meets all of the requirements of subchapter XVI with respect to eligibility for supplemental security income benefits; or
(cc)
is a child whose costs in a foster family home or child-care institution are covered by the foster care maintenance payments being made with respect to the minor parent of the child as provided in
section 675(4)(B) of this title; and
(II)
has been determined by the State, pursuant to subsection (c)(1) of this section, to be a child with special needs; or
(ii)
in the case of a child who is an applicable child for the fiscal year (as so defined), the child—
(I)
(aa)
at the time of initiation of adoption proceedings was in the care of a public or licensed private child placement agency or Indian tribal organization pursuant to—
(AA)
an involuntary removal of the child from the home in accordance with a judicial determination to the effect that continuation in the home would be contrary to the welfare of the child; or
(BB)
a voluntary placement agreement or voluntary relinquishment;
(bb)
meets all medical or disability requirements of subchapter XVI with respect to eligibility for supplemental security income benefits; or
(cc)
was residing in a foster family home or child care institution with the child’s minor parent, and the child’s minor parent was in such foster family home or child care institution pursuant to—
(AA)
an involuntary removal of the child from the home in accordance with a judicial determination to the effect that continuation in the home would be contrary to the welfare of the child; or
(BB)
a voluntary placement agreement or voluntary relinquishment; and
(II)
has been determined by the State, pursuant to subsection (c)(2), to be a child with special needs.