If I understand your question correctly, you want to know if the present perfect or the simple past is best for this situation because you don't know if he is still learning.
Ask yourself this: Did he already learn everything he needs to play as he plays right now? yes/no If the answer is yes, his learning to play piano is completely in the past, so ask, "How did you learn to play the piano?" or "How did you learn to play? or "How did you learn? Don't put the pronoun 'it' at the end.
"How have you learned to play the piano?" (not "How has you learned piano?) is also correct, but for two distinct reasons:
1. You assume he is still learning.
2. This verb form is also used to talk about something in the past that is interesting right now. Since you are interested in this information, you can correctly use, "How have you learned?" even if he is done learning.
If you ask, "How did you learn?" and he is still learning, he might reply, "I have learned to play my entire life?" or more likely, if he is a native speaker, he'll actually say, "I have been learning to play my entire life? which means the same thing but is slightly different verb tense.