We use two binaural cues which are based on the comparison of the signals from sounds that are picked up by the left and right ears. Interaural time difference portrays the difference in sound when the sound reaches the left and right ear. If a sound is located to the left of you, then the sound reaches your left ear before it reaches your right ear, therefore letting you know that the sound is coming from your left side. Interaural Level difference is based on the difference in the sound pressure level of the sound reaching each ear. The head creates a sound barrier also known as an acoustic shadow, which reduces the intensity in sounds on the ear farther away from the sound. This barrier only exists for high frequency sounds. Low frequency sounds are not affected by the head. These two binaural cues help us with auditory localization, in which we can locate the position of sound in three locations: azimuth (left and right), elevation (up and down), and distance. This video demonstrates how researchers have used technology to mimic how our brains use interarual time difference and interaural level difference to determine where a sound is coming from and have the machine turn towards the sound.
Another interesting video (which you must listen to with headphones to get the full effect!) also shows how our brains use binaural cues for sound location. This audio clip allows us to feel like we are really in the situation and that someone is moving around us and talking to us.