For how long it would take to train for esports, like Hassan mentioned it depends on who's currently doing it. Unlike more established sports like basketball where you can play in high school, college, and then get recruited, esports recruitment doesn't really follow that path. You also have to look at the game you decide to play. For instance, if you focused solely on Marvel vs. Capcom Infinite (which unfortunately flopped), you probably wouldn't have a longstanding career. There are people that play it, but it doesn't garner as much of an audience anymore. If you focused on fighting games in particular (Street Fighter V, Under Night-in Birth, Guilty Gear, Dragon Ball Fighterz), you might have more staying power. But fighting games as a whole are diverse, and you could become a "jack of all trades, master of none" if you split your focus that way. This doesn't begin to cover sponsorship, how to apply for that, and making sure you get a fair deal for the time you're putting into games.
Now for YouTube, that also depends. It can be a slow build where you consistently make content and attract people slowly but surely. Or, you could randomly hit the jackpot with a viral video and boom! 1000 subscribers overnight. The second one is highly unlikely especially on an oversaturated platform like YouTube, so I recommend making content you enjoy that other people also enjoy watching. Then promote your content on other platforms and network with other creators.