The YouTube app isn't compatible for Apple CarPlay, for obvious reasons of distraction whilst driving. You can continue to use the YouTube app on your iPhone and have the sound come out of CarPlay, but you cannot display the video from YouTube on your CarPlay display from your connected iPhone. There IS a way though, and that is through an Android AI Box and some wireless CarPlay dongles are starting to support streaming over AirPlay for video apps like YouTube. All streaming apps from iPhone will carry copyright restrictions, so apps like Netflix, Disney+ and Amazon Prime Video will not work, however YouTube, Plex and videos from your Camera Roll will be able to stream from your iPhone.  AI Boxes will run directly from the AI Box, cutting out your iPhone, meaning these copyrighted apps WILL display on your CarPlay display as long as you provide the AI Box an internet connection, which can be from your personal hotspots from your phone or an inserted SIM card (if available).