At sunrise and sunset, the sun is closer to the horizon. The sunlight passes through a denser layer of air and covers larger distance before reaching our eyes. Most of the blue light gets scattered. The light that reaches our eye is red. That is why the sun appears red at sunrise. At noon, the sun is overhead. The sunlight passes through lesser layers of air and covers shorter distance before reaching our eye. So, almost all colours of light are scattered equally. Hence, the sun appears white.