So I was a bit confused. Hydrogen and Boron seem to be the only outliers to the octet rule. Hydrogen makes sense because it has only one shell and 2 electrons complete its shell. Boron's configuration, however, is $1s^2 2s^2 2p^1$. Having 6 valence electrons would mean having a configuration of $1s^2 2s^2 2p^4$ which doesn't seem as stable as $1s^2 2s^2 2p^6$ or even as stable as $1s^2 2s^2 2p^3$ since one would think that there is repulsion going on between electrons in the first orbital of p in $1s^2 2s^2 2p^4$. Thanks in advance!
The principle of full octet is that most reactivity patterns are described well if there is a driving force / energetic gain for full octets in main-group atoms.
However, the only facet of an atom that dictates anything about the number of valence electrons is its nuclear charge. Boron has a charge of 5. This is balanced by 5 electrons. Two of them are core electrons and the remaining 3 are valence electrons. The valence electrons may participate in bonding through sharing with other atoms, to make three bonds. Three bonds = six electrons.
That is the simple answer. The way this question is posed indicates you are very new to the study of chemistry, and this next bit goes well beyond an introductory chemistry course.
For a fourth bond to form, another atom would have to donate two electrons to the bond. This happens in many cases, such as when an amine reacts. In other cases, an atom already bonded may donate electrons, such as in boron trichloride. Finally, borane gas itself can engage in 3-center two electron bonding which is really weird, but provides a full octet when two boron atoms share the bonding electrons in a boron-hydrogen bond.
Don't distress, boron has many ways to get is full octet.