Correct Answer:
C. had completed
This sentence describes two past actions: completing homework and having dinner. The action of completing homework happened before dinner yesterday. The past perfect tense ("had completed") is used to indicate an action that was finished before another past action or a specific point in the past. The keyword "before" clearly signals the need for the past perfect to establish the sequence of events. "Completed" (simple past) would imply it happened at dinner or after, or without a clear sequence. "Completes" (simple present) and "has completed" (present perfect) are incorrect as the action occurred "yesterday".