This is more about etiquette than English. However, "How do you do?" is a fixed greeting used mainly in Britain when greeting a stranger for the first time. The correct (formal) response is to repeat the phrase. The greeting is (or was) commonly used by the British upper classes, and a different response, e.g. "Very well, thank you", or "Fine, thanks", may be considered a social error. A well known source of British etiquette guidance is Debrett's Handbook of Modern Manners:
Introductions are usually followed by a handshake and the words: ‘How
do you do?’ to which the response is: ‘How do you do?’
Social graces and introductions (Debretts)
With younger people and in more informal settings you may prefer:
‘Hello’ or even ‘Hi’ but resist adding: ‘Pleased to meet you.’ Never
assume that ‘How do you do?’ means: ‘How are you?’
'How are you doing?' is an informal greeting and there are no rules about the correct response, although a brief answer is probably best. The person greeting you probably does not want to hear your recent medical history.