Sorry, this seriously needs to be corrected first.
What does "Rawr" actually mean?
One day, a friend who I hadn't seen for a long time messaged me and wrote "rawr". I thought he was just acting cute. Later on, I understood it means "I love you" in dinosaur.
Still, I don't get it. Under what conditions do people say this? I mean, whether it is normal for people to use it to say hi.
The joke is, "Rawr" means "I love you" in Dinosaur. This is a cute little internet joke (now a little out of fashion), and you'd only use it if you knew the other person would understand the joke. So, I understand your confusion. It's not a normal way of greeting people at all, so forget about using it to greet friends. (You will just look weird. Very, very weird.)
Aside from that, I don't know why your friend would write rawr to you. Was he being cute and affectionate?