A former Riverhead High School teacher and soccer coach was sentenced Wednesday to three years in prison for soliciting nude images from underage girls and sending them sexually explicit images of himself.