Basically there are two aspects of saying greetings.
- You want to greet or wish someone ethically (as cultural practice where we live)
- You live in religious society where you greet target person accordingly.
First, peace is the key element to prevail in a society. Ethically we usually need to wish or greet to different people to have good relationships or sometime a kind pre-gesture is good before starting any business talk, which makes discussion environment a friendly. This is a general understanding about greeting to someone.
Now how should you greet? To have a good social relation we need to greet someone in his way but being in our religious boundaries. In Islam, Allah has mentioned in Quran that when you see other Muslim you should say "salam or Asalam-o-Alaikum" which is an exact Arabic grammer. This in English means "peace be on to you". So what does this means in Islam? This a kind of short wish we pray to Allah that: May Allah keep you in peace and safe.
Muslims always say their prayers and wishes to Allah so this is the whole concept and background.
In religion context the Islam is the most final and complete religion human follow or should follow, as other religions that people follow are actually denying the last and final order from Allah.
Let's make it short here as this answer should be precise and relevant only.
Muslims can not say " Salam" to non-muslims because the non-muslim is not accepting Allah's last order so he is no more following Allah. So in a cultural society we should greet other person accordingly that he feels nice about.
Lastly, Allah is not our Servant or employee ( may Allah forgive me of using these words but for others understanding) that he is bounded to do what we wish him to do.
Allah says in Quran, I created this universe and life so I can see who does the good deeds and do good practices among you.
Tried to answer being in possible right way. May Allah forgive us and show right path to us.