"stai" is the conjugation for the second person singular informal [tu].
come stai? - you're talking to a friend, family, a child.
"sta" is the conjugation for the third person singular and second person singular formal [lui, lei / Lei].
come sta? - you're talking to someone you've never met, your boss, older people, etc.
lui sta con lei - you're talking about a third person, a "he" in this case.