How to say: How are you?
Just add (ma) to the greeting formula "! (Ni hao!)" changing it into a question!
How are you? (Ni hao ma?)
literally: You good
" (Ni hao ma?)" actually differs from the English greeting "How are you?" in the way it is used. While the English "How are you?" is also an everyday greeting, in Chinese you should ask " (Ni hao ma?)" only if you really want to ask about the state of health or condition of a friend.
If you just want to greet a person, after a warm "! (Ni hao!)" it's better if you say something like " (Ni chi le ma?)", literally meaning "Did you eat?"
I know, it would sound strange asking to an English speaking person "Did you eat?", right? The answer maybe would be a surprised "Why?"
Well, it's the same if we ask to a Chinese person " (Ni hao ma?)" The reaction would be something like "Sorry, I don't understand, I was not ill, I didn't survive any car accident, why are you asking me how I am?!?"