This has a little to do with polarity and a little to do with bond strength and solubility.
First, for something to dissolve in water, the compound must be similar in nature to water. In other words, it must be highly polar or possibly ionic. The second component deals with the ionic compounds and the strength of their attractions. Small atoms or highly charged atoms are less likely to dissolve because the attractions are very strong between the ions.
Let's consider the compounds and first identify if they are nonpolar covalent, polar covalent, or ionic. If you aren't sure here, please ask me for clarification with a comment.
MgSO4 - ionic (maybe dissolve)
C2H2 - nonpolar covalent (nope)
CH4 - nonpolar covalent (nope)
CaO - ionic (maybe dissolve)
From there, only the ionic ones will potentially dissolve in water. In reality, the ability to dissolve depends on lots of factors. For now, just use the solubility rules. Find one to use as a reference. You will mostly look at the anion first to determine solubility.
MgSO4 - the chart says sulfates are mostly soluble, with a few exceptions - This means MgSO4 will dissolve in water.
CaO - The chart says most oxides are insoluble. This means CaO will NOT dissolve in water.