When compounds form, the connectivity of the atoms will determine the structures that they form. In forming compounds, atoms without a formal charge will have a typical number of bonds.
The term constitutional isomer refers to one of two or more molecules that have the same molecular formula but different structural arrangements of atoms and bonds. For example, ethanol and dimethyl ether are both represented by the formula C2H6O, but the atoms are bonded together differently.
Most atoms form a set number of bonds based on their number of unpaired valence electrons when combining to form a neutral compound, a compound with no formal charge. Hydrogen has only one valence electron, so it forms one bond. Oxygen has six valence electrons (two unpaired electrons and two lone pairs) and can form two bonds. Nitrogen has five valence electrons (three unpaired electrons and one lone pair) and forms three bonds. Carbon has four valence electrons (four unpaired electrons) and forms four bonds to create an octet. The halogens (fluorine, chlorine, bromine, iodine, and astatine) are the most reactive elements, with seven electrons (one unpaired electron) in their valence shell, and form a single bond.
Atoms that form one bond are monovalent; atoms that form two, three, and four bonds are referred to as divalent, trivalent, and tetravalent, respectively. Halogens and hydrogen are monovalent. Oxygen and sulfur are usually divalent. Nitrogen and phosphorus are usually trivalent. Carbon is tetravalent.