YouTube Music requires a subscription to listen to in the background, if you have a subscription and it's still not working it may be due to the low specifications of that phone.
Depending on the model you have, it has either 1 or 2 GB of RAM, which is a really low amount for modern phones (and which is also why it's an Android Go phone). Because there's so little RAM, the firmware likely kills apps in the background aggressively (or doesn't allow apps to run in the background, like music apps).