Because space is 3D and electrons spin 1/2,

Zero orbital angular momentum is the most tightly bound electron of an atom. Because of the spin, you have two options to place an electron in that orbit: spin up or spin down. This means that you can place 2 electrons in the most tightly bound orbit.

Wolfgang Pauli first proposed the “exclusion principle”, which states that you cannot put another electron in any orbit unless it is spinning differently. This is commonly referred to as “you cannot put two things in one place at the same moment.” (The exclusion principle is applicable only to electrons, but not to photons. You can put as many photons in one orbit as you like.

That’s two. To disagree with your question, you can have stable shells with only two electrons. This is exactly what happens with the helium-atom.

There are no limits to the number of electrons you can have, but there is a limit to how many electrons you can have. There are three ways to orient your orbits if you have one unit angular momentum. This is measured in Planck’s constant units divided by 2 pi. Because space has three dimensions, this is because it can be arranged in 3 ways. Each orbit can contain two electrons (spin-up and spin-down), and the orbit with the most tightly bound electrons has 6 electrons.

I’m skipping some important points. For example, you can have 3 orbits in 3D space with unit angular momentum. This is due to quantum physics. There are also many other answers that refer to the Schrodinger equation. These answers are accurate but don’t really get to the heart of 3D space. There could be many more orbits if space were in 4D.

It adds up to 8.

One strange thing about electrons. You don’t get the exact same electron quantum state if you rotate them 360 degrees in space. Instead, you get one that is identical but with a minus sign. This is really strange, but experimentally it has been shown to be true. The minus sign affects how the electron interacts with itself when it travels along two paths simultaneously.