잘 지냈어? (jal jinaesseo)
For extra formality you could add 요 (yo) at the end of the phrase.
잘 지내세요, when you say it as a statement rather than a question, means "have a good day". When said in the tone as a question, it means "how are you?" 잘 지냈어 and 잘 지내세요 basically mean the same, but 잘 지내세요 is more polite.
잘 지내셨어요 is "have you been well?"
Other way to ask:
어떻게 지내세요? (eotteohke jinaeseyo?)
안녕하셨습니까? (an nyeong ha siut seum ni ka?)
Answer:
잘지내요 (jaljinaeyo) - I am fine
잘 모르겠어요 jal moleugess-eoyo - I am not well
몸이 안 좋아. - My body is not feeling well
난 괜찮아 오전 - I am okay or I am so so..