How can we count layers of atmosphere even though there are no lines or boundaries which separate atmosphere?
Just because it's transparent to the human eye, doesn't mean they are the same. They differ in chemistry, physical properties and the dominant processes. One of the main distinctive properties of the layers in the image you show is the temperature, the boundaries are indicated by where the temperature gradient reverses sign.
The troposphere is the densest, surface-most layer which is where the weather happens, quite turbulent, temperature decreases on average adiabatically.
Above you find the stratosphere which is mostly well stratified and not so much turbulent as the troposphere - and temperature rises the higher you get until the stratopause. It's the region you find the ozone layer.
The thermosphere again is indicated by declining temperature the higher you get, but is already very thin (less than 1/1000 of surface pressure). Much of the air here is already ionized (the ionosphere is part of the thermosphere).
And beyond that you find the exosphere where the most abundant constituent is hydrogen as it's lighter than the heavier elements nitrogen and oxygen which make up most molecules in the lower atmospheric layers. As far as you can still assign a temperature, it is getting hotter the further up you go.