If the alleged offense occurred after your 18th birthday, then you cannot be treated in the juvenile court. It’s that simple. The age of 18 is the cut-off. There are some other ages that are significant, so if you’re over 16 and you commit a certain class of offenses, then the prosecution can charge you directly into adult court. There is a section of the Welfare & Institutions code, the governing law for juvenile cases, that provides for Direct Filing of serious offenses into adult court; alternatively, when you are above 16, the prosecutor has that discretion to file in adult court by way of petition and subject to a fitness hearing.
A Juvenile Court Jurisdictional Hearing is held to determine whether or not the minor will be treated in juvenile court or sent up to the adult court for prosecution there. It is advised to get help from a California Juvenile lawyer in such a case so you get professional legal counseling.