교장 선생님 means "principal" (교 is school, 장 is chief in this instance). 성함 is the formal word for 이름, meaning "name". 어떠게 되십니까 or any variation thereof is very similar to the phrase "me llamó" in Spanish, meaning "I am called". It's like asking, literally, "How is the principal's name called?" which we interpret as "What is the principal's name?"
I guess you're confused by the latter "성함이 어떻게 되세요".
It's a set expression to ask about someone's name in a very formal way. You can use Duolingo's word by word translations to help you remember it, but I remembered the whole phrase as is.
"교장 선생님은 성함이 어떻게 되세요? " principal name how is it (very literal) 교장 선생님: Principal 성함이: Name(Formal) 어떻게 되세요: What is/ How is it
성함 is name. 성함이 어떻게 되세요 Is one of the ways Koreans ask for name. A literal translation would be, how did you become "name", which in English does not make much sense, so, just take the whole thing to mean What is [possessive] name? 선생님 Is teacher. (학)교장 Is the leading teacher, as in principal.
Literally you might go for "head teacher" (교장 선생님은). The word to follow is due to politeness issues (성함). It is the honorific form of 이름 (name). And as you see with the verb ending and with the teacher noun in general, the use of honorific forms is adequate here.
In general please try endic.naver.com or the Naver app. They are the best for looking up words in or into Korean.
Or the Naver Dictionary app. You can search words in Korean and English and it gives you the base forms as well.
Yeah, all the above mentioned Naver tools are pretty powerful.
Surprisingly, when translating full sentences, Google translate also does a very good job ever since they drastically changed their algorithm for a few selected languages (including Korean).
They didn't change their algorithm per se last time things got really different. They switched to machine learning. Presumably the translations improve themselves continually as Skynet studies each language and how to interpret between them.
"성함이 어떻게 되세요" is an honorific expression. It is my understanding that "뭐예요" should not be used for one's principal.