(1) When a person is convicted of the unlawful delivery of cocaine, methamphetamine, heroin, fentanyl or ecstasy to a person under 18 years of age, the court shall sentence the person to a term of incarceration ranging from 34 months to 72 months, depending on the person’s criminal history.
(2) The sentence described in subsection (1) of this section does not apply to a person who is less than three years older than the person under 18 years of age to whom the controlled substance was delivered, unless the person has a previous conviction for delivery of cocaine, methamphetamine, heroin, fentanyl or ecstasy to a person under 18 years of age.