When my homeroom students log in to their dashboard, they see their courses and the courses for my afternoon students as well. How do I set their dashboards so that they only see the courses that they are enrolled in?
All canvas users, regardless of role, will only see the courses in which they are enrolled - either on the dashboard, or in the Courses index. If your students are seeing that course, then they are enrolled in it. Did you check the enrollments in your afternoon course?
Otherwise there is a problem with how students have been entered into your school's student information system which feeds those enrollments to Canvas. I would check with your school's Canvas Admin, because the members of this Community are unable to access or troubleshoot accounts and course beyond their own.