Send 1 + 2 as inputs to one node (A).
Connect output of node A to one input of another node (B), image 3 to the other input of B, send B output to the composite.
If you are using alpha over you need to make sure you have them hooked up to the inputs in the right order so that the image that should be on ‘top’ shows up on top (it has to go in the second input).