The problem with all these conflicts is winning is so poorly defined or multi-goal.
What's winning in Syria? Getting rid of assad and then leaving? We could probably do that in a week or less and utterly demolish the country if we wanted. The consequences of 'winning' that war under that definition would probably be pretty horrible.
But that doesn't seem to be the goal right now?
There's the wider goal of not wanting to poke the Russia bear too much while simultaneously not letting Russia run too wild (arguably they are..).
Though Afghanistan is pretty simple imho. there aren't nearly as many global power stakes... The taliban explicitly does not want Democracy so if that is 'winning' it's doomed to a loss by default.