(a) Upon the application of a relative to become a foster parent of a child in foster care, the court shall, subject to the provisions of this subdivision, hold a hearing to determine whether the child should be placed with a relative in foster care. Such hearing shall only be held if:

(i) the person is related to the child as described under paragraph (a), (b), or (c) of subdivision three of section four hundred fifty-eight-a of the social services law;
(ii) the child has been temporarily removed under this part, or placed pursuant to section one thousand fifty-five of this article, and placed in non-relative foster care;
(iii) the relative indicates a willingness to become the foster parent for such child and has not refused previously to be considered as a foster parent or custodian of the child, provided, however, that an inability to provide immediate care for the child due to a lack of resources or inadequate housing, educational or other arrangements necessary to care appropriately for the child shall not constitute a previous refusal;
(iv) the local social services district has refused to place the child with the relative for reasons other than the relative’s failure to qualify as a foster parent pursuant to the regulations of the office of children and family services; and
(v) the application is brought within six months from the date the relative received notice that the child was being removed or had been removed from his or her home and no later than twelve months from the date that the child was removed.
(b) The court shall give due consideration to such application and shall make the determination as to whether the child should be placed in foster care with the relative based on the best interests of the child.
(c) After such hearing, if the court determines that placement in foster care with the relative is in the best interests of the child, the court shall direct the local commissioner of social services, pursuant to regulations of the office of children and family services, to commence an investigation of the home of the relative within twenty-four hours and thereafter expedite approval or certification of such relative, if qualified, as a foster parent. No child, however, shall be placed with a relative prior to final approval or certification of such relative as a foster parent.