The Rock Cycle
To truly grasp why coal and limestone differ, you need to establish some baseline understanding about rocks in general. What you might see as a single mineral or rock is merely but a single step in a greater chain. All minerals and rocks are in a constant state of slow flux. Weathering takes existing rocks, and through the actions of wind, water and chemical action degrades them to silt, sand and dust. These remnants fall beneath your feet (sometimes upon the sea floor) to become layers. Over time, pressure and heat convert these layered remains into minerals and rocks, where forces of uplift and volcanism bring them to the surface again. Depending on the process by which they reach the surface, these reconstituted soils become simple rocks or transform into minerals. At this point, nature begins weathering them, and the process begins anew.
Limestone Formation
Limestone is formed by a process of sedimentation. Instead of being composed by weathered rocks, limestone begins as the "skeletons" of countless organisms that die in the seas. These skeletons are composed of a chemical called calcium carbonate (also known as lime). These remains form deep layers of silt on the ocean floor. Over hundreds of thousands of years, other layers of sand and silt cover these layers of silt and they become compressed. The constant pressure of overlaying layers and the weight of the ocean converts the silt into a rock composed of lime.
Coal Formation
Coal starts as prehistoric swamplands and bogs, which layers of sand and silt cover. Subsequent layers of deposited materials compress these bog-graves into a layer of dense organic materials composed of ancient plants and animals. Through various geological actions, such as uplift and deformation, these deeply buried compost-like layers become twisted and sheared. Shearing creates heat and pressure, which chemically alter the organic soup. Much like leaving the stove on for too long, over time, all that remains of the bog-brew is a carbon-heavy residue. More time and pressure convert that residue into a hard rock called coal.
Other Distinctions
It is important to point out while limestone and coal both begin as layered organic material, the processes that create them vary primarily by what happens afterwards. Limestone remains chemically identical to the organic calcium carbonate that composed it. The variances in limestone colors (which vary from pure white to dark brown) are caused by impurities in the layers, not due to a chemical difference. Because it is basically little more than a rock made of sediment, limestone is classified as a sedimentary rock. Coal, on the other hand, has a chemical makeup that is drastically different than the organic materials that comprised it. Because of this process of change, coal is classified as a metamorphic rock.