Spark, fuel, or air. I would guess fuel flow, since it runs good when riding. You could have a restriction in a fuel line or a leak.... which is a problem when starting, but is not severe enough to be an issue when running. Would check the in line fuel filter near the gas tank, make sure fuel lines are secure and not cracked, including inside the gas tank. Could try replacing fuel lines if not relatively new. Could consider a carb rebuild as well. Could also try replacing spark plugs. They’re cheap and easy to replace.
A hack might be to install a primer if you don’t have one already. Might want to test putting some fuel directly into the carbs (like a primer) and see if it starts right up. Good luck.