; (2) by striking except that with respect and inserting the following: except that— (i) with respect to assisted dwelling units in a project assisted with project-based assistance under this section, the tenant selection criteria used by the owner— (I) shall provide that the highest preference shall be given to otherwise eligible children who are in foster care, have attained an age such that the provision of foster care for such child will end by reason of the age of the child within 6 months, meet the requirements under clauses (i) and (ii) of paragraph (1) of the definition of at risk of homelessness in section 91.5 of the Secretary’s regulations (24 C.F.R. 91.5), as in effect on September 1, 2016, and have agreed to comply with the requirements under section 39(c); and (II) may provide highest preference to, in addition to eligible children described in subclause (I), not more than two other types of eligible families; and (ii) with respect ; and (3) by inserting who are not eligible for highest preference pursuant to clause (i)(I) after to be assisted . (e) Terms and conditions on priority Title I of the United States Housing Act of 1937 ( 42 U.S.C. 1437 et seq.) is amended by adding at the end the following new section: 39. Terms and conditions on preference for assistance for children aging out of foster care (a) Preference For purposes of this section, the term preference for housing assistance means preference, for an otherwise eligible child in foster care, for— (1) occupancy in a public housing dwelling unit, pursuant to section 6(c)(4)(A)(iii); (2) tenant-based assistance under section 8(o), pursuant to paragraph (6)(A)(ii)(I) of such section; (3) project-based assistance under section 8(o)(13), pursuant to subparagraph (J)(ii)(I) of such section