The only 1st gen's were G17's (and maybe G19's but I don't think so), the G20 came out after the 17 was updated to the 2nd gen, so even the first run of G20's were 2nd gen Glock's.
Dionysusigma's pic shows the differences very well but there were also a few G20's and G21's that came out with the 3rd gen finger grooves but with no rail, those are usually referred to as 2.5 gen's (or something to the effect), I have seen a few but not often.
Other than the frame moldings (and the loaded chamber indicator on the newest 3rd gen's) there are two other changes between the 2nd and 3rd gen's, 1st being the back of the 3rd gen's ejection port, it's angled back a few degrees vs the 2nd gen's more squared off 90 degree port, the 2nd is under the breech of the 3rd gen's, it's milled down and ramped a little to reduce friction on the sear when pulling back the slide on a cocked striker and to put less pressure on a fully loaded mag when the slide is closed.
I have a 2nd gen G20 that has been a great shooter and has never had a failure, if the one you're looking at is in good shape and you don't have a need for the rail then you can't go wrong with it.