When sunlight hits the atmosphere, the blue light is scattered more than the other colors because it has a shorter wavelength. This is because the blue light waves are more likely to interact with the molecules of nitrogen and oxygen in the atmosphere. The other colors of light, such as red and yellow, have longer wavelengths and are less likely to be scattered. As a result, the light that we see from the Earth from space is mostly blue.
The amount of scattering also depends on the angle of the sunlight. When the sunlight is coming from directly overhead, there is less scattering and the Earth appears lighter blue. When the sunlight is coming from an angle, there is more scattering and the Earth appears darker blue. This is why the Earth appears to be a different shade of blue at different times of the day and from different locations on the Earth.