Ever since the release of iOS 14, people have been struggling to get YouTube to work on the iPhone as Picture in Picture. YouTube's policy is to only allow paying customers to use this feature. So you'll need to buy a YouTube Premium subscription if you want to be able to watch for example your favorite show or music in YouTube and in the meanwhile to be able to browse the internet or do whatever other thing you want on your iPhone.
The methods currently available are more or less hit and miss -- you never know if they still work, or if the method applies to the current version of iOS, whether you need to install third party applications, or create custom shortcuts. I definitely don't like installing another app, just to be able to use the Picture in Picture feature that YouTube is actively trying to block. At the same time I feel I am taken hostage and forced to pay ransom in order to use a feature that was designed to be free in the first place.
A very simple way to watch YouTube picture in picture without any other apps or tricks is to watch a video in Bing. Yes, good old Bing the search engine. In Safari on iPhone, if you search for the YouTube video on bing.com, and you play it on bing.com, then it will allow you to activate Picture in Picture.
I just found out this today, 29 June 2021, so I have no idea how long this has been on for or for how long from now on will this work. I tried this successfully on iPhone Xs Max running iOS 14.6.
These are the detailed steps on how to get a YouTube video to play in Picture in Picture mode with Bing:
1. Open Safari on iPhone
2. Go to bing.com
3. Search for the video you want to see
4. Click on the YouTube video in the Bing search results page
5. Click the play button and the video starts playing in full-screen mode (browser is still on bing.com)
6. Activate Picture in Picture mode from full-screen mode
Et voilà!
Let me know below if it works for you and which iPhone and iOS you have...