Shave and a Haircut: The Classic Two-Part Rhyme Explained
The song you're thinking of is the "Shave and a Haircut" rhyme. It's not really a song, but a two-part call and response:
* "Shave and a haircut" (sung or spoken)
* "Two bits" (answered)
The "Two bits" part is usually accompanied by a specific rhythm (often played on a door, a drum, or any convenient surface) of two short notes followed by a longer note.