In the name of Allah, the most compassionate, the most merciful
Briefly speaking, typically, the first person who intends to say hello (as a greeting), he or she says:
- Assalamu Alaikum/Alaik
But the second one who want to reply to his or her Salam, tells:
- Alaikum/Alaika Salam (which demonstrates being the second part who is saying back his/her hello
Otherwise seemingly you can use both of these two forms in replying, although "Alaikumo Salam looks to be more accurate/formal in compare with the other form (in reply).