Limestone and marble are chemically the same rock. They are made up of Calcium Carbonate. The difference is in how they are formed. Limestone is a sedimentary rock and Marble is Metamorphic. Sedimentary rocks are made of {you guessed it) sediments that accumulate at the bottom of a body of water and over time are buried and solidify to become rocks.
Imagine now that over millions of years that rock gets buried deeper until the temperature and pressure become high enough to break the bonds of the minerals in the rock. The rock deforms and recrystallizes into a new rock. The rock may be uplifted by tectonic movement and exposed by erosion, and viola we have marble.