You have to drag from the left-bottom corner or the right-upper one. They're marked, as you can see in this image:
To delete a window, just drag from the one that you want to keep to the other one. Anyway, you can change the direction of the merging action later if you don't release the left button.
Note that you need to merge two windows with the same height/width. Look this layout as an example. The red arrow marks not working merging operations and the blu ones valid operations.