Yes, the question is basically asking which are the most abundant elements, though it's specifically asking about elements that form molecules and this is presumably why the second most abundant element helium is excluded (helium being chemically unreactive).
Big Bang nucleosynthesis produced mainly hydrogen and helium, with small amounts of lithium and beryllium but nothing else. However in stars three helium nuclei can fuse to produce carbon. Once carbon is created it produces nitrogen and oxygen in the CNO cycle, so as stars burn, the amount of carbon, nitrogen and oxygen keep building up. When stars shed their outer layers into space (gently in the case of red giants or rather more violently in the case of supernovae!) the most common nuclei puffed out into dust clouds are hydrogen, helium, carbon, nitrogen and oxygen.