Just so see how other countries do it: In Germany. Children under the age of 14 are never tried. They are always under age of criminal responsibility and can never be tried.
From 15 to 17 they are always subject to the laws of young offenders that demands lower sentences and even more focus on rehabilitation.
From 18 to 20 they can be tried as adults or young offenders depending on their degree of maturity (not the magnitude of the crime). In practice 90% of offenders 19 to 20 are charged as young offenders.
It counts how old they were when the crime was committed. So even very old people can be charged as juveniles which recently happened for guards in Nazi camps who were juveniles at the time of the crime and where tried very recently.
(I am not an expert in any of these topics for neither Germany nor the US and if anything I say is the same in the US I was not suggesting it was not)