Fossils form in sedimentary rocks such as limestone, shale and sandstone. The other two types of rock, igneous and metamorphic, form under conditions unsuitable for fossils.
Fossils are most common in limestone and least common in sandstone. Fossils form more often in shale than in sandstone but less often then in limestone. This is due to how they are formed: limestone is made of the shells of dead organisms, shale is formed from fine-grained mud sediment and sandstone forms from sand.
Igneous and metamorphic rocks do not contain fossils due to the high temperatures and pressures involved in their formation. Igneous rocks form when magma cools, and metamorphic rocks form in the extremely high temperature and pressure under Earth's crust.