(a) Except as provided in subsections (b) and (c) of this section, an order under this subtitle vesting legal custody in an individual, agency, or institution is effective for an indeterminate period of time.

(b) An order providing for custody of a child adjudicated delinquent or in need of supervision may not exceed three years from the date entered. However, the court may renew the order upon its own motion, or pursuant to a petition filed by the individual, institution, or agency having legal custody after notice and hearing as prescribed by the Maryland Rules.

(c) An order under this section is not effective after the child becomes 21 years old.