Drag the logic gates (and other items) onto the grid, link them by dragging the green dots to the item you wish to link with.
Click the green play button on the red on/off button to turn it on or off
Click the link for more information about logic gates