When I listen to music on YouTube and click the home button to go to my messages etc it turns off. Lots of websites say that I should press the home button twice then click play but it still doesn't work
i think the answer you're looking for lays by another app.
the app is called foxtube. the apps saves you tubes video's on your iPhone and you can play them while using other apps. Also you can make playlists of video's that automatically play after each other.
i hope this helped you out.