Picture-in-Picture mode is available in Android TV but now this mode is available in all new Android that is Android O. Now check here: How to Enable Picture-in-Picture mode in Android O.
The process to use this feature is quite simple, you just need to do is go to youtube app and play any video then slide your video down and now press home button and video is continuously playing, check out the video for more details. The first thing you have to do is activate the System UI Tuner in Quick Settings by holding down the Settings icon. Then navigate to Settings > System > System UI Tuner > Navigation bar and enter 171 in either the Left or Right keycode, which should enable the PiP mode on your device.