Halogens (F,Cl,Br, I) have general electronic configuration is ns2np5.Generally, they required one electron to complete its octet.
A divalent halide is a halogen anion with a valency is 2, but this is not possible because halogens are one electron less from completing their octet. So halogens are monovalent and they make halides (X) by accepting one electron.
But in some cases, halogen forms divalent. Example XeF2,CaCl2