Working of optoisolator MOC3041 & triac connection
Here is the schematic:



MOC3021, MOC3041 and MOC3020 are all similar and can be used in the same way. Same goes for your triac.

Live is usually connected to MT2 (middle pin in BT136) and appliance is connected to MT2. I am not sure whether this is actually required. You should be able to get away with opposite connections as well.

The signal Triac1 comes from your micro controller.

Once you have made the project successfully, you will most like face these issues:

1) Triac not turning off in a few cases specially while driving fans.

2) Tubelights or bulbs connected to other triacs flickering momentarily during switching on/off fan.

3) Similar erratic behavior.

To get rid of these issues, you need to look into snubber design and it's application. You might need two snubbers - one for MOC and one for triac. A little costly but better way is to use snubberless triacs (BTB16-600 BW for example) and high dV/dt rated optocoupler (FOD420 for example).