Do atoms react to fill outer shell or 8 valence electrons?
Excellent question I must say.
To middleschoolers they really don't teach advanced concepts regarding orbitals. But since this question came to your mind, I guess you're capable of handling what I have to say next.
Unlike what's taught to you, shells don't exist just like that, they exist as a collection of subshells. Subshells are given names such as $\mathrm{s}$, $\mathrm{p}$, $\mathrm{d}$, and $\mathrm{f}$. The number of subshells a shell has is given by it's principal quantum number, or simply the shell number. In this way, the 1st shell has only one subshell, which is $\mathrm{1s}$. The second shell has two subshells; $\mathrm{2s}$ and $\mathrm{2p}$. The third has three subshells; $\mathrm{3s}$, $\mathrm{3p}$, and $\mathrm{3d}$.
Every subshell is further composed of orbitals. Orbitals are different from orbits, orbits have electrons in a precisely defined path, while orbitals show a cloud of probability of where the electrons could exist. Each orbital holds two electrons.The orbitals also have exciting shapes:
The $\mathrm{s}$ subshell consists of just one orbital, the $\mathrm{s}$ orbital. It's a spherical cloud of electron probability:

The $\mathrm{p}$ subshell consists of three orbitals, $\mathrm{p}_x$, $\mathrm{p}_y$, and $\mathrm{p}_z$. They are dumb-bell shaped, oriented along the $x$, $y$, and $z$ axes respectively:



The $\mathrm{d}$ subshell has five orbitals, $\mathrm{d}_{xy}$, $\mathrm{d}_{yz}$, $\mathrm{d}_{zx}$, $\mathrm{d}_{x^2+y^2}$, and $\mathrm{d}_{z^2}$. They have interesting shapes.





The $\mathrm{s}$ subshell can hold two electrons, the $\mathrm{p}$ subshell can hold six electrons,the $\mathrm{d}$ subshell can hold ten electrons, and the $\mathrm{f}$ subshell can hold fourteen electrons.
In middleschool, they teach you to fill the lower electrons first, and move to the top, if you want to find the electronic configuration of a given element. Unfortunately, that's not entirely correct. Infact, considering the subshell concepts, you must use the Aufbau Principle. The rule tells us to fill the electrons in the order given in the picture below:

(source: boundless-cdn.com)
If the picture wasn't clear, the order is $\mathrm{1s}$, $\mathrm{2s}$, $\mathrm{2p}$, $\mathrm{3s}$, $\mathrm{3p}$, $\mathrm{4s}$, $\mathrm{3d}$, $\mathrm{4p}$, $\mathrm{5s}$, $\mathrm{4d}$, $\mathrm{5p}$, $\mathrm{6s}$,...
Do you notice that $\mathrm{4s}$ comes before $\mathrm{3d}$? Thats why you don't get those ten extra electrons of $\mathrm{3d}$, since the $\mathrm{4s}$ subshell is being filled for the elements potassium and calcium.