がどこにいるのか

where someone is

→ が
phrase Uncommon #18,854
where someone is Used to embed a question about someone's location within a larger sentence. The person before が can be a name or a noun, such as メアリーがどこにいるのか (where Mary is).
JA: 彼がどこにいるのか分かりません。
EN: I don't know where he is.

トムメアリーがどこにいるのか尋ねた

Tom asked Mary where the dog was.

ジョンがどこにいるのか誰も知らないようだ

It seems that no one knows where John is.

トムメアリーがどこにいるのか聞いた

Tom asked Mary where the dog was.

トムがどこにいるのか定かじゃない

I'm not sure where Tom is.

トムがどこにいるのかあなたに話すつもりはありません

I don't intend to tell you where Tom is.

トムメアリーがどこにいるのかさえ知らないんだ

Tom doesn't even know where Mary is.

自分がどこにいるのか分からなくて彼女は路上で立ち止まって道を尋ねた

Not knowing where she was, she stopped on the street and asked for directions.

トムがどこにいるのか正確には知らないよ

I don't know exactly where Tom is.