If one met one’s friend in the market (in a happenstance way) one may
greet him with good morning and not Shalom. If this is a powerful
person, and one meets him on the way, one can tell him "Shalom" .
This prohibition only applies to greeting someone, but it’s
permissible to respond to someone who greeted you.
One may not go to someone’s house to greet them with “Shalom” once the
time for Shacharit began. If one met the person on the way, it is
preferable not to greet with “Shalom”.
Once the time for Shacharit comes until one said Brachot HaShachar one
may [not] greet one’s friend with the word Shalom but rather with good
If one went out of one’s way to greet one’s friend, one should not
greet him with good morning, even if one already said Brachot
That article also lists the original sources, primarily from Mishnah Brurah