There's no way to tell ahead of time, unfortunately. Like many other features in the game, greetings come about after interacting with a character who has a thought bubble over their head. So if you see a character with a thought bubble over their head, they may want you to pick a greeting, but they may also want a number of other things.