In the Twelve Labors of Hercules, the underworld dog Cerberus commonly had three heads.
Cerberus guarded the realm of Hades and prevented the dead from leaving. His three heads are the familiar form used in modern retellings, although ancient sources and artworks sometimes gave him additional serpentine features, such as a snake for a tail or snakes around his neck.
Hercules had to capture Cerberus alive and bring him to the upper world as his final labor in the usual sequence. Hades allowed the capture only if Hercules subdued the animal without weapons.
The number three is not meant to identify every detail of every ancient depiction. Mythological descriptions varied over time, and some writers expanded Cerberus’s monstrous appearance. Nevertheless, “three-headed dog” is the standard canonical description used in accounts of Hercules’ labor.