[verb (plain)] + ことなの [i-adj] + ことなの [na-adj] + な + ことなの [noun] + の + ことなの
ことなの is the noun こと, "thing, matter", followed by the explanatory なの. It presents something as a matter of a certain kind – "it's something that…", "it's a matter of…" – and explains or insists on it. A clause in the plain form goes in front of こと.
Because こと is a noun, it takes な before の, just as any noun does: ×ことの, ×ことだの. A な-adjective in front of こと keeps its own な: たいせつ大切なこと, not ×大切こと.
The sentence can end on ことなのだ or ことなんだ in plain speech, ことなのです or ことなんです in polite speech. なんだ and なんです are the spoken contractions.
With a rising tone, ことなの? asks the listener to confirm what something is or what it amounts to.
The last one is ということ with なの, "does that mean…?" – the most frequent form of the question.
These go beyond a plain statement or question.
Inside a longer sentence, ことなのだと reports a realisation, and ことなのか raises a question for someone to think over.
After a のは clause, ことなの names the point itself: "what matters is…", "what he's angry about is…".