In general, ionic compounds with ionic bonds are soluble in water and those that with covalent bonds are not soluble in water.
There are two main types of bonds, ionic and covalent.
Ionic bonds are formed between metals and nonmetals.
Ionic compounds are similar to water in that they have a positively charged portion and a negatively charged portion (the metal is positive and the nonmetal is negative).
Water has a positively charged portion (the hydrogen side) and a negatively charged portion (the oxygen side).
There is a saying in solubility chemistry: "Like dissolves like." So many ionic substances will dissolve in water.
Covalent substances are generally nonmetal elements bonded to other nonmetal elements.
They do not have a positive end and are therefore not like water.
Most covalent substances are not soluble in water.
Exceptions occur with small covalently bonded substances like alcohols and sugars: they will dissolve in water. Covalently bonded substances are more likely to dissolve in other covalent substances..