Alright, so evertime you go out and jam with a band, or just play with the radio or a song, I always make a mistake and end up playing in a different key.

Hence my question: how can i figure out what key the people are playing in?

I know some people are going to mention chord progressions; but what exactly are they?

say im playing along with the song "Hey Jude"

The first 3 chords are F, C, F, How would u try to make a solo over that.

Usually i have done this: looked up the chords from a tab (this case F) went to the fret noteboard cheat sheet, look at the first fret and see that it is F, and play a minor pentatonic scale or a Major position 1 (http://www.justinguitar.com/en/SC-001-TheMajorScale.php). But it still doesn't add up.

I realize that there are SOO many things im doing wrong here, I tried figuring it out, but no luck.
There a few tricks to figuring out the key to a song, and I'll give you a quick diagnostic.

Normally, songs are based around the I, IV, and V(7) chords. Music is always moving around these, yet this is the basis.

What this means (if you're not familiar with intervals), is that the "root," "fourth" and "fifth" chords are the most common.

In the key of C Major, these chords are C, F and G7.
1 2 3 4 5 6 7 1
^ ^ ^

Another trick is to use the first and last chords of a song, as they're commonly the root. However, if it starts with F, and goes to C, and you're not sure where it goes to, you can always take a gander for chords that don't belong in each key, Such as any chord with a Bb (Gm, Bb), would be in F major but not C major. Also, look for that dominant seventh chord (in C Major's case it'd be G7, in F major, C7. If the C chord had a seventh in C major, it'd likely be a CM7).

If you're still unsure, look for chord diagrams that may list the key of a song, and if all else fails, I'm always open to help

Happy playing.