I'm a native speaker and I believe that in spoken language ( dialects) we only use it as a greeting. Same thing for MS Arabic ( language used in books, media, etc). By the way, this is originally the Islamic
way of greeting. (However, Christians now use it as well)
Extra info :
The full form of this greeting is : Assalamu alaikum wa rahmat allah wa barakatuh. السلام عليكم و رحمة الله و بركاته
, both in dialects and MS Arabic, which means : Peace, mercy and blessings from God be upon you. ( long, right ?
You can skip the ' wa barakatuh' part (blessings), and just say assalamu alaikum wa rahmatullah.
The answer to the greeting is : wa alaikum assalam
wa rahmatullah wa barakatuh.
It's believed that the more you say, the better. Even today, many people say the full form
. I don't use this greeting ( except with very religious people
). I just say "marhaba" which means : hello.
You can also say 'salamu alaiko', but this form is only in dialects.
Also, a very important thing to know, this greeting is in the plural form no matter what. Even if you talk to one person. ( both in dialects and MS Arabic)
When it comes to MS Arabic, you say assalmu alaikunna if you are talking to a group of women, girls, etc.