Well, as you know there are three types of rock. There are , and . Let’s think about all of them and why some can contain , but the other can’t. But first of all what is a fossil?
Fossils are organic products which are preserved in the Earth’s crust. This means that the fossil is usually formed on or under (but not too deep!) the or under the water. In other words in the biosphere (think about the biosphere limits). Then this organic material is covered by debris and etc. and becomes the fossil material.
Now the igneous rocks, these rocks are usually formed from extremely hot magma deep inside the crust or with severe (not always) lava explosions. Obviously, magma and lava can’t contain any lifeforms, because they come from the deepest and hottest places on the Earth where life is impossible. That’s why fossils can’t be found in the igneous rocks.
The metamorphic rocks also can’t contain any fossil as you’ll see below. How does the metamorphic rock form? Simply the igneous rocks (Which CAN NOT originally contain any FOSSIL) or the sedimentary rocks (Which CAN originally contain some FOSSILS) undergo extremely high pressures or/ and temperatures. But in these conditions rock’s, even if they originally contained some organic material, structure will be altered.
Finally, the sedimentary rocks are the one type which can contain fossils because these rocks are formed on the Earth surface, under the water etc. In other words, the biosphere can only interact with the sediments.