That's complicated, because although you believe the student can have no more than two courses, the "real world" often doesn't work like that. If nothing else, a design where the student is assumed to only have two courses is dangerous because that is exactly the kind of thing that gets changed later. If you don't allow for it, you will make your life a lot, lot more complicated later.
It can be done -
SQL Pivot: Converting Rows to Columns - The Databricks Blog[
^] is intended for it - but that's complicated.
It's also possible to cheat:
SELECT StudentID, MAX(CourseNumber) AS Course1, MIN(CourseNumber) AS Course2
FROM MyTable
GROUP BY StudentID
But you can't change that later when you need three courses.
To be honest, you really need return the course list as separate rows (and sort that out in your presentation language) or return it as a comma separated list of values in a single column and deal with that in your presentation language.
You can do that in SQL Server like this:
SELECT StudentID, Courses=
STUFF((SELECT ',' + CONVERT(VarChar(10), CourseID)
FROM myTable b
WHERE b.StudentID = a.StudentID
FOR XML PATH('')), 1, 1, '')
FROM myTable a
GROUP BY StudentID
But I have no idea if that will work in Access.