Not knowing your particular background or skill level the question is incredibly broad. From the point of view of an experienced improviser what's going on here is fundamentally very simple.
Pianist 1 is playing around in A minor. If you don't have the ability to recognise a pitch from memory (perfect pitch, I don't have it and it's a very rare ability) then it will take some little initial guess, or watching the pianists fingers for the notes they are using, to determine the key. A bit of aural skill helps here, as in after a few seconds listening you hear they are going to a home chord of some kind of minor tonic. Pianist 2 looks at pianist 1's hands and see's there are no flats or sharps used, so it must be in C or A minor (or some mode, but that would sound 'different' and is less likely to be the case in the majority of simple jams like this). Next up he determines it sounds minor, so it's probably A minor. Although this is easy to determine with a bit of practice, especially when you are hearing someone play diatonically, if there was any doubt in pianist 2's mind that it was an a minor tonic and not another minor chord from our diatonic list of chords a quick peek at pianist 1's hands and what keys he is playing would answer any question right away, it all looks familiar, uses all the white notes and ends on an A minor, it's in A minor.
Pianist 1 is playing two chords to reach the final one. Given that we are probably in the key of A minor (down to seeing the lack of black keys pianist 1 is playing) now a bit of ear training will quickly tell you that the approaching chords are from the same key as the home chord, and a bit of knowledge of chord theory will tell you that the chords that reside under the tonic of A minor, stepwise, are F major and G major. This sounds a little abstract, but as almost all music obeys, to some degree, the patterns found in the diatonic major/minor scale remembering the order of chords (and how they sound) becomes second nature, as you have to recall it so often.
So we are left with pianist 2 having identified pianist 1 is in A minor, and playing the two chords below it to lead up to the tonic.
Although I don't have perfect pitch and couldn't accurately guess that it was in A minor without looking at the video or grabbing an instrument it's very easy to hear that we are going 'IV V vi' in some key. This may be familier to you, but if not you just need to look into 'chords in a major scale' and 'relative minors', then spend a bit of time playing around until you start to hear the relationships and recognise the movements we have here. In time you can listen to a chord sequence and make a pretty good guess at what's going on before even playing a note.
After that, it's simply 'variations on a theme'. The two pianists are now feeding off each other and reacting to the confidence built each time the chord sequence is completed in such a way that they are able to experiment a little, confident that they can predict the next chord based on the repetition. Then you can just try out different techniques. Pianist 2 is accompanying, broadly, and varies the way he plays the chords with arpeggios, a bit of stride playing and some melodic playing. Pianist 1 is then free to worry less about the chord accompaniment and focus' on melodic playing around the A minor scale. He plays it safe, sticking mainly to minor pentatonic playing with the odd passing note, following the basic rules of beginner improvising ie. stick to strong chord tones, resolve nicely each time the sequence ends etc. Playing it safe is absolutely fine in this kind of impromptu jam.
Developing your own feel for how to improvise a melody is something with no strict rules, it's on-the-spot composing in some way, but with a bit of practice you can find some ways that make your ideas sound more lyrical, and more musical. Very broadly these can be;
Don't start on the 1 of each chord all the time.
Don't start on beat one of each chord all the time.
Try and construct short phrases, like sentences, that have a beggining, middle and end.
Repeat ideas to build up a sense of some kind of intent,
develop a phrase once it's established.
These are a very simple starting points, I could carry on writing arbitrary ideas like this for days, and in the video the musicians don't follow even points 1 and 2 of these very much at all. They make up for it by following points 3 and 4 quite nicely, and after all this is a jam at a train station between strangers, not a composed piece! It's a form of very simple improvisation demonstrated very well in an odd, impromptu setting. I don't mean to sound derogatory to the musicians, it really is a good example of how you can get something basic going between two stranger-musicians with no forward planning.
I would suggest just playing the chords, F G Am Am (as they are here) in your left hand and just noodle in the right hand on the white keys and you'll get something similar. Once you have gotten used to that you can explore how to embellish it in ANY direction, from additional notes, chord extensions, different keys, different techniques etc. The biggest thing to learn will be the sound of each note choice on each chord, get used to how some sound simple or sombre, some sound exciting, some sound floaty, some sound beautiful. Build up a dictionary of what intervals sound like to you. After that it's phrasing of melodies in the right hand. Once you are satisfied with that stuff and want more then you just add ever more complex chord sequences, new sounds and techniques until you get to jazz and beyond!