Where does he live?

彼はどこに住んでいますか。

Do you know where he lives?

彼がどこに住んでいるか知っていますか。

Do you know …? / Please tell me … / I don't know … の後ろに疑問文を入れるとき、中の順は 疑問詞 + 主語 + 動詞 に戻します。

ルール○×
疑問詞 + 主語 + 動詞Do you know where he lives?Do you know where does he live?
be動詞も主語の後ろI know where the station is.I know where is the station.
who が主語なら、普通は did を足さないI know who wrote this book.I know who did wrote this book.

does を消したら動詞に s を付けて lives、did を消したら過去形に戻します(where he lived)。 ただし、強調する場合には who did write のように did を使うこともあります。

文全体が疑問文かどうかは、外の文で決まります。Do you know where he lives?(?)/ I know where he lives.(.)。