what; how many. Use なん before です/で/の. Use なに before を/が/も. This distinction appears on every JLPT test.
何(なに)、何人(なんにん)、何時(なんじ)
what, how many people, what time
Use "nani" before particles (何を, 何が) and "nan" before counters (何人, 何時, 何月). This distinction appears on every JLPT test.
From the JLP Quiz question bank — the word in the form it is actually tested in.
彼は本当のことを知っている ___ だ。でも何も言わない。
Answer: よう
あそこに人が集まっています。何か起きた ___ です。
Answer: よう
もし宝くじが当たっ ___ 、何をしますか。
Answer: たら
「何時」の読み方はどれですか?
Answer: なんじ
「今___何時ですか?」の___に入ることばはどれですか?
Answer: は
「何時」の よみかたは?
Answer: なんじ