In the molecular level, the factor that determines the physical state of matter would be the arrangement of its atoms. If they have a compact arrangement, the matter is solid. If the atoms are very far from each other, the matter is gas. If it is far, but not quite, then it is liquid.
In the macrolevel, the chief factor would be properties. Solids has definite shape and volume. Liquids are free-flowing but does not have a definite shape. Gases are invisible.