Normally YouTube video will be stop/pause paying if you minimize the YouTube or if you open another app.
But if focus on music or audio instead of video, you need to play the video as background.
To make this possible, open a browser. Here let’s see with Google chrome.
Then open www.youtube.com. If this trigger YouTube app then try with m.youtube.com on chrome.
Open the options. Just mark ‘Desktop site’ to make the YouTube as like in Computer.
Now search and play the video that you want to play as background.
Minimize the chrome. Now the music may stopped. So just open your notification bar. There you can see the video as paused, just tap on the play button.
That’s enough. Enjoy
This works well with Android, and not sure with iPhone.