(D) The electronic configuration of an element having $5$ electrons in its outermost $p$-subshell is $ns^{2} np^{5}$. This corresponds to the halogen group $(Group \ 17)$. Examples include $F, Cl, Br, I$.
$(b)$ An element with $2$ valence electrons $(ns^{2})$ tends to lose two electrons to attain a stable noble gas configuration. This is characteristic of $Group \ 2$ (alkaline earth metals) such as $Mg$ or $Ca$.
$(c)$ An element with $6$ valence electrons $(ns^{2} np^{4})$ needs $2$ more electrons to complete its octet. This is characteristic of the oxygen family $(Group \ 16)$ such as $O$ or $S$.
$(d)$ $Group \ 17$ (halogens) contains elements in different states at room temperature: $F$ and $Cl$ are gases,$Br$ is a liquid,and $I$ and $At$ are solids (non-metals/metalloids).