Sun roofs are designed to leak. It's all about water management, what gets past the glass has to be directed out of the cab. The cat whisker keeps almost all the water out. What does get past it is supposed to go out the four drains. The first thing to do is confirm the drains are open. There is a metal trough all the way around the opening that catches the water and directs it to the drains. Open the roof completely and pour water (from a water bottle) slowly in the trough leading to each of the drains. Water should appear fairly quickly behind the front wheels for the front drains, and behind the cab for the rear drains. You might have to get the truck a little nose high to get the water to flow into the rear drains. If water does not go down, or starts to back up the drain is plugged. Be careful if you try and blow them out as you can blow the hose off the nipple and you then have to drop the headliner down to reinstall it. If the water drains out quickly, the sun roof is not the problem.
You then have to continue water testing using a SMALL stream of water starting at the cab vents below the rear window and working your way up to the window and then up to the CHMSL. Go SLOW, sometimes the water takes a little time to appear on the inside.