The existance of the matter in these three state depends on the interactions among the particles.
1) If the interactions between the particles are very strong and they are tightly bound to each other then the substance is said to be Solid. Solid possesses a definite volume and a definite shape. For eg. -Iron, Sugar, Gold, Wood, etc
2) If the interactions between the particles are very weak and they are not bound that is, they can move freely then the substance is called as Gas. It neither possesses a definite volume nor a definite shape. This is because they fill up the whole vessel in which they are put. For eg. - hydrogen, oxygen, carbon dioxide, nitrogen, etc.
3) But if the interactions between the particles lie in between of solids and gas, then the substance is said to be Liquid. It possesses a definite volume but no definite shape. They take up the shape of the vessel in which they are put. For eg. -water, milk, alcohol, oil, etc