What conditions must be present to enable a material to dissolve in another material?
Likes dissolve in likes, so both substances either have to be polar or non polar.
If the solvent is a gas, then the solute must be a gas too.
If the solvent is a liquid, then the solute can be gas, liquid, or solid.
Also, the prescence of heat is a necessary condition for a solid to dissolve in a liquid.