Three steps:
(1)
Thoroughly wash/scrub the roof. If it's a non-membrane roof, give it a good wax job. This will minimize the "dirt runoff" from the roof. Keep the roof clean.
(2)
To help keep the windshield itself clean, or MUCH EASIER to clean:
I make up my own homebrew "Windex"... in about a gallon of water in a small pail, add about a cup of ammonia and 3 or 4 drops of Dawn liquid dish detergent.
THOROUGHLY scrub/clean/squeegee the windshield. Be sure to clean your wiper blades with the same solution.
(3)
Then apply a good coat of a glass wax product - Rain-X or similar - to the windshield. Most brands of that stuff work about the same, and will need re-applied every so often.
If you drive over 50 mph in the rain, you probably won't even need your wipers on!