One thing Griff says to do (and I didn't see it mentioned so I thought I'd point it out) is before you try to learn a new song/solo/whatever listen to it over and over and over again. Try to internalize it before you pick up your guitar. Another teacher I have (a bass teacher, Paul Wolfe) has similar advice. He says before you attempt to play it, listen to it until you get pig sh!t tired of it, then listen to it some more.
Skipping this step is a mistake (according to Griff). I agree with Griff.
Once you really start to internalize it, you'll probably find counting becomes easier...makes more sense in context.
And when you 1st start, you don't need to have perfect timing...in other words lose the metronome. Let me try to explain it this way.
If you have a quarter note followed by a triplet then two eight notes and another triplet (that's 1 measure in 4/4 time) you would count it: One | Two and ah | Three and | Four and ah
Here's the point. You don't necessarily have to hold your first beat (One) as long as your 2nd and 4th beats (which are triplets). But you DO have to count it out loud and play each note on it's appropriate place in the measure. Playing it this way when you first start learning it may not be perfect timing (against a metronome), but that's okay. Just make sure you're counting it correctly. After you play it to your count and you begin to "feel" where the notes go, then you can start working with your backing track and/or metronome to really dial in your timing.
When you first start learning this way, it is tedious/arduous/difficult. But if you keep at it, you'll find that before too long it's easier and easier to do. You also want to learn to count with less complicated/easier rhythms before you get into the more challenging triplets and sixteenth notes.
To sum up, if you find yourself having difficulty counting, ask yourself if you did step one (before you attempt to play it, listen to it over and over again until you're pig sh!t tired of it, then listen to it a bunch more). Then count it out without a metronome/backing track until you start to get the feel of when to play the notes. After you can do that then you can play over a backing track or metronome. At this point you may have to play it slower than you want by slowing down your backing track without changing the pitch, then gradually increase the speed until you can finally play at performance tempo. And do yourself a favor and learn to do this starting with simpler rhythm patterns progressing gradually into more complex rhythms.
Hope this helps a little.