Fir someone you have known for a long time it depends on your relationship.
Examples:
Hey, mom... You do not have to use a greeting in all situations you can just say their name and begin talking if you are really close.
Hello, sir... Hello is polite, so it is directed towards those who have a superiority over you. Such as a boss or teacher.
Hi, is a quick greeting to someone you are well acquainted with.
Howdy, is for those who you meet in a casual conversation.