Rayleigh scattering occurs when light scatters off of small particles in the atmosphere. Rayleigh scattering is isotropic and favours shorter wavelengths which means that blue light is more likely to scatter than red light.
During the day, this is the reason the sky is blue as the blue wavelengths tend to scatter off of particles in the atmosphere and into our eyes while the red wavelengths pass by over head.
However, when the sun is setting, the light must travel through more atmosphere and so the blue wavelengths are scattered away from our sight, while the red wavelengths are left to propagate through the atmosphere and into our eyes.
It is because of the relative amounts of each wavelength that we perceive blue or red versus when we perceive white which is a mixture of all "colours".