The type of matter you are referring to is called a liquid. Unlike solids, which have a fixed shape, liquids will conform to the shape of their container. However, they do occupy a specific volume, meaning they take up a definite amount of space.
To illustrate this, think about water. When you pour water into a glass, it takes the shape of the glass, but no matter how the glass is shaped, the amount of water remains the same unless you add or remove some. This behavior is due to the arrangement of molecules in a liquid state; they are close together but still have enough energy to move around freely, allowing them to change shape while maintaining a constant volume.