Using HAVING is correct, you just need to use it correctly
SELECT Teacher
FROM Students
GROUP BY Teacher
HAVING COUNT(Student) > 3
Basically you're grouping Teacher records together while counting how many Students each teacher has. And filtering on that count.