What you're looking at there is a "slip joint".
If you loosen and remove the large white plastic nut (the "twisty screw thingy"), you should find a rubber or plastic gasket/ring underneath it.
This ring is supposed to fit snuggly around the upper pipe, and the nut tightens down onto it, which then forms the seal between the 2 pipes.
To put this all back together, after unscrewing the nut and removing the ring, first slide the nut up onto the upper pipe, then slide the ring up onto the pipe below the nut.
Make sure that you put the ring on the right way around - the beveled edge should be at the bottom (pointing towards the lower pipe) and the flat edge should be at the top (next to the big nut).
Raise the lower pipe up so that the upper pipe slides into it, then hold it there while you slide the nut & ring down, and tighten the nut.
The nut only needs to be 'hand tight' - you should not use any tools to over-tighten it.