Answer:
B. By the time Mary got home, Sam had eaten dinner.
Step-by-step explanation:
The past perfect tense shows that something happened before another action in the past. This tense is formed with the helping verb had plus the past participle of the main verb. In this case, it is had eaten. (Eaten is the past participle of the verb eat).