How is the earth's atmosphere divided into layers?

It is not actually divided into layers by nature. It is a constantly changing mass of gasses with water in suspension with different temperatures and pressures constantly changing their relationship with one another. The notion of layers is only a human tool, a model, to help us understand it better. The first layer, the one which holds all terrestrial life, is the troposphere.

Then there is the stratosphere, mesosphere, thermosphere, and exosphere.