The solution below works for me. I am using iPhone 7+ iOS 10.3.1
1) Clear safari browsing history and data from settings > Safari
2) Open youtube.com in safari private browser
3) Request for desktop site
4) play the video , it will become full screen
5) wait for a few seconds ( like 4 , 5 seconds )
6) hit home button ( both video and sound will stop )
7) Pull up the control center and swap to view media player.. you should see the title of YouTube video and click play button to play
8) Press power button to off your screen, video will continue to play in the background.. you can play/ pause from control center or using the button from ur earphone
Hope it helps ..