When people who are familiar with each other use a greeting, they'll also often ask how are things. There are two common phrases used to ask how someone is
In the Spanish language, we differentiate between informal and formal language. To show respect, to one's collegues or to someone you don't know, one uses formal language (¿Cómo está?). For friends and family, you can use informal language (¿Cómo estás?).
Replying to greetings is easy. You can return the greeting, and ask how someone is doing. If someone has already asked you a question, you can reply and then ask the same of them.
In this example, we have been asked how we are. After answering the question, we ask the same. This example uses informal speech, so let's see what formal speech would be like.
In this case, the dialogue isn't very different. You should notice, however, that we used the word usted rather than tú. Both word mean you, but usted is the more formal form. This fits with the formal form of the question (está not estás).