A teenager who planned a mass murder by setting fire to a mosque has been sentenced to 10 years in custody.