The school year in Scotland runs different to England resulting in an occasional difference in age.
Roughly speaking, you start school if your fifth birthday is within 6 months or so of September in Scotland, whereas in England you have to be five by September of the year you start school.
Most people are 18 though, though you do get some 17 year olds and even the very occasional 16 year old, as we can go after our Highers rather than after sixth year.