Before going out, rehearse the greeting at home with a toy: 'hello' and a wave, then 'bye' and a wave.
Outside, greet someone yourself first while your child watches from your arms or your side. Model it, do not push them forward.
If they wave, that counts. If they hide, that also counts — say the greeting for both of you and move on without commentary.
Greetings are social scripts, and scripts have to be rehearsed somewhere safe before they can be performed somewhere public. Rehearsing at home means the child arrives already knowing the words, which is what lowers the barrier.