When should I say what's up and when should I say how are you?
Is it about the person's age or the extent of my knowledge of the person?
Both these phrases can be used to send the social message that you are making a friendly greeting. In other words, they can be used phatically. Used so both phrases mean the the same, but the social propriety of each may differ. In general, "How are you" is formal, always polite, but perhaps a bit too stiff for close acquaintances in any casual context. "What's up" is informal and may be viewed as lacking in gravity or respect. If you are being introduced to the Secretary General of the U.N. for the first time and say, "What's up, Tony," you are likely to be thought a boor. If you are happy to see your sister for the third time this week, you might well say, "What's up today."
Of course, these phrases can also be used non-phatically. For example, if you have just been in a car wreck and a cop asks "how are you," he is asking about your sense of physical wellbeing rather than sending a friendly greeting. And the question "what's up" would make no sense in that context at all.