Nodding your head yes in America means that you are saying yes. While shaking your head means no. This is said to have come from bowing. People used to bow as a sign of acceptance but over time it turned into a simple head gesture.Another place this gesture may have come from is babies. When a baby wants milk they nod their head, but when they do not wish to drink milk they shake their head.
In America nodding your head means yes but in Bulgaria it is the opposite. If you nod your head it means no while shaking your head means yes. Even though it is opposite in Bulgaria, they still make it a point to switch up this gesture when talking to tourists.
Here is a .gif of this gesture.