In some compounds like Beryllium Chloride (BeCl2), Boron Trifluoride (BF3), Aluminium Chloride (AlCl3) some atoms have less than 8 electrons in their valence shell. Group IIIA elements and Be of group IIA form this type of compounds. For example the electronic configuration of boron is B(5) = 1s2 2s2 2p1.
Since it has three electrons in the valence shell, it can share only these three electrons Since in covalent bond formation the equal number of electrons are shared between atoms in normal compounds, boron can have three pairs (i.e., 6) electrons in the outermost Shell.