PIR sensor detects a human being moving around within approximately 10m from the sensor. This is an average value, as the actual detection range is between 5m and 12m. PIR are fundamentally made of a pyro electric sensor, which can detect levels of infrared radiation.
Since, sun radiates infrared radiation so it may detect it but since the distance is very large, that's why it cannot. To detect sun the distance between them should be very low.