There are really only seven diatomic elements. Five of them — hydrogen, nitrogen, fluorine, oxygen and chlorine — are gases at room temperature and normal pressure. They're sometimes called elemental gases. Bromine is always a liquid, while iodine can be a liquid or solid when at room temperature, depending on a number of factors. All seven are nonmetallic.
Other elements of course can bond together; those are called diatomic molecules. That's how we get table salt (sodium + chlorine = NaCl, sodium chloride). Diatomic molecules like this are found everywhere. Some other elements can form diatomic molecules, but the bonds are very weak and unstable. They don't stay diatomic for long. Only these seven diatomic elements form strong bonds and are found in this form almost always.
That's not to say that diatomic elements are rare — on the contrary! Nitrogen and oxygen, in their diatomic forms N2 and O2, make up 99 percent of Earth's atmosphere. That's the opposite of rare.
Need an easy way to remember these seven? Try this mnemonic: Have No Fear Of Ice Cold Beer. The first letter of each word will remind you of each diatomic element.