the idea that 8 "valence electrons" are required for a stable molecule is a simplification they teach you in high school chemistry to make things easier. Many molecules do not exhibit normal 8-electron valence, such as boron trihalides and transition metal complexes. Typical transition metal complexes follow the "18 electron rule" which is also a simplification. There are many complexes with different electron counts. To understand the full picture of chemistry, one must manually calculate the molecular orbital energy levels via the Schrodinger equation. Even then, "orbitals" and their associated energy levels are a simplification of the real picture. A complete analytical solution is only really possible for one-electron molecules and atoms, such as the hydrogen atom and various ions. Even these are subject to the Born-Oppenheimer approximation. Nonetheless, various estimation methods for equations for more complex systems which are not analytically solvable exemplify the great successes in modern physical chemistry. Many molecules can be simulated and their spectra predicted from these models with great accuracy.