There are no ionic compounds in distilled water.
In comparison, rainwater contains a lot more chemicals.
Carbon dioxide from the air is one of the acidic gases that rainwater has dissolved and turned into carbonic acid. This indicates that it contains carbonate and hydrogen ions. Therefore, rainwater can conduct electricity when there are acids present.