One more student chiming in. (This is an example of the blind leading the blind leading the blind... hooray students!). I believe you're on the right track thinking about smaller atoms but maybe don't quite have the reasoning right.
You'll eventually learn about hybridization and molecular orbital theory. Small atoms like N only have electrons in their s and p orbitals. When you learn about orbital shapes and hybridization you'll see how electrons in s and p orbitals make
σ bonds and
π bonds and what single, double, and triple bonds really are.
Bigger elements have electrons in their d and f orbitals! The
d orbital is especially cool and it can make
δ bonds.
Molecular orbital theory helps explain bond orders and other things (like why dinitrogen is a triple bond and why dioxygen is paramagnetic!) and if you go to the big elements involved in compounds like
dimolybdenum you'll see
sextuple bonds!
So yes it has to do with the "size" of an atom and the number of electrons it can hold. But really the big difference between N and Mo is that Mo already has electrons in a bunch of different orbitals -- many of which are very close in energy and can form interesting bonds.