To acquire a degree, a student must complete two science courses.
To acquire a degree, two science courses must be completed.
In the first sentence, the person doing the action (a student) is named in the subject, so the opening phrase doesn’t dangle.
For more help, see section S3-e.