If I want to ask a friend of mine where he is living could I use both sentences below in the same context?
1 where are you living
2 where do you live
If both are wrong, then what is the difference between 1 and 2?
They are both OK English.
'Where are you living?' would be used more often when you know the other person is living somewhere temporarily for some reason, or does not have a fixed home. The verb form is the present continuous which we can use to talk about something which we think is temporary, for example: I'm working in London for the next two weeks.
'Where do you live?' would be used for a general enquiry about a person's home location, and uses the simple present.