Think about what definite shape and definite volume means.
Let's say that you start with three containers of equal volume. The first container hold a 100-g coin, the second holds 100-g of water, and the third 100-g of gas, all at room temperature and normal pressure, both kept constant.
Definite shape means that if you take the substance out of the container and move it to a container that hass a different shape, the substance will not change the shape it had in the initial container.
If you take the coin out of the first container and put it in your wallet, what will happen to its shape?
Of course, the coin's shape will not change.
Can you say the same for the other two substances? What if you pour the water from the second container into a champagne glass, will its shape change?
Yes it will. What if you pour the water into a beer glass? Once again, its shape will change.
In the gas' case, it's obvious that the shape will change because it doesn't have a definite shape to begin with, it takes whichever shape its container has.
So the solid is the only one that has definite shape.
Definite volume means that the same mass of substance occupies the same space.
Once again, the gas will not be a candidate because if you double the size of the third container, the volume the same amount of gas occupies will now be twice as big.
The same 100-g sample will not occupy twice the volume, so you can't say that the volume of a gaseous substance is definite.
What about the water?
If you double the volume of the second container, the water molecules will not spread around the container, they will remain close to each other.
If you make the volume of the container ten times bigger, the water will still occupy the same space on the bottom of the container.
The same is true for the coin. The molecules in the coin will stay packed together regardless of what volume the container has.
So, substances in the gaseous state have no definite volume and no definite shape. Substances in the liquid state have defintie volume, but not definite shape.
Finally, substances in the solid state have both definite volume and definite state.