For close friends, I tend to say "Hey!".
If it's a group, I'll say "Hey guys!" or "Hey you all (or y'all if you prefer).".
If it's just an acquaintance or someone I don't know very well yet I will usually say something in terms of what time of day it is like: "Good morning." "Good afternoon." (usually, I shorten to "Morning."/"Afternoon.").
For strangers, if it is just in passing (not formal, like walking by someone on the sidewalk, etc) I would just smile and say "Hi.".
If it is someone I am meeting in a more formal setting I would say "Hello, my name is _________. (Then give the reason I am introducing myself).". In this situation, sometimes when they respond to introduce themselves I will say "Nice to meet you.".
Body language is as important as the words. It's always nice to smile when you are greeting someone!