Android: Unless you use YouTube Red, playing videos in the background on Android is probably pretty rare. That's changing in the new Chrome Beta, which allows you to play videos from web pages in the background. Yes, even YouTube. In Chrome Beta 54, if you're playing a video in a tab and then leave Chrome, you'll see a little notification showing the video you were watching. It will automatically pause (presumably so you won't continue to be annoyed by auto-playing ads when you try to back out of a web site), but you can tap play to begin playing it again. Audio streams can also play in the background, but they won't be paused when you leave Chrome.
As Android Police points out, video playback even works on YouTube right now, which is super helpful. However, since background playback is a paid feature of YouTube Red, it's likely that this will be blocked in the near future. Still, you can enjoy it for now as a little reward for testing out the beta.