Three allies and I are in a room fighting an enemy. On his turn, the enemy goes underground. Waiting for him to pop up, can I ready my action with my bow saying, “When an ally yells, ‘Over here!’ I attack there”?
Is this possible?
The only restriction on the trigger is that your character can perceive it. Hearing something is a perceivable circumstance.
But for your specific circumstance I want to add, that cannot move as part of a readied attack, so you cannot attack the enemy if he is out of range/reach or stands behind full cover.
The ready action (SRD93)
First, you decide what perceivable circumstance will trigger your reaction. Then, you choose the action you will take in response to that trigger, or you choose to move up to your speed in response to it.
When the trigger occurs, you can either take your reaction right after the trigger finishes or ignore the trigger.
In your example, your ally yelling is the perceivable circumstance and the attack action is your response.
The important parts of the ready action are
1thanks to @mattdm for number 4