Igneous rocks- form when hot, molten rock crystallizes and solidifies
sedimentary rock- when pieces of rock are loosened by weathering, then transported to some basin or depression where sediment is trapped, if the sediment is buried deeply it become compacted and cemented forming the rock.
Metamorphic rock- when rocks are subjected to high heat, high pressure, hot mineral-rich fluids, or more commonly, some combination of these factors