1) If they bow first, bow as low as they do, keeping eye contact.
2) If you bow first, they should bow lower than you.
3) The superior person (or customer) receives the deeper bow.
4) If in doubt, a head nod is sufficient from foreigners.
NOTE: Bows go from a head nod to a 45º bow, and even to kneeling.