Metal and non metals
Electricity is conducted when charges move from one place to another. In metals, the conductivity is due to delocalized electrons that can wander all over the place.
In solid ionic compounds, on the other hand, the ions aren’t going anywhere. The cations and anions all attract themselves into a nice lattice and they’re stuck there until they have a better reason to wander off.
However, if you melt an ionic compound or dissolve it in water, these ions are now free to move around. As a result, the solution can be made to conduct electricity.