To enable picture-in-picture mode on YouTube, tap the profile portrait icon in the top-right corner of the YouTube app. If you pay for a YouTube Premium subscription or live in the United States, you can easily watch YouTube in picture-in-picture mode on any device running Android 8.0 Oreo or higher.
How to Watch YouTube in Picture-in-Picture Mode on Android