When it is written in this form though:
elemental Br=[Ar]3d^10 4s^2 4p^5
you can look at the highest energy level (in this case 4) and then get the valence electrons in these orbitals (in this case 7 valence electrons), that is why each bromine gets one electron, to have eight valence electrons and have a stable octet. That is why it shows eight valence and not 18