To livestream Google Stadia on YouTube, start a game, open the Stadia menu, and choose the "Live stream" menu option.
To play YouTube videos in the background while doing other things on your iPhone, you can use YouTube premium or Safari's desktop view mode.