A collection of atoms or molecules can form a solid at a given temperature or pressure if the bonds between them possess some required qualities.
The qualities the bonds must possess are:
– Be rigid, but allow the atoms/molecules to vibrate in place.
– The atoms/molecules will remain around a central position unless an external change removes the property of the bonds that are holding the atoms/molecules together.