I suggest you have around 20 mA as the input current to the MOC3021. The typical forward voltage is about 1 V, so you want about 100 Ohms for R5 if the microcontroller supply is 3 V, and about 200 Ohms if the supply is 5 V.
You don't need R1 and R2. Either can be used, and the other can be 0.
The output current for the MOC3021 is more difficult to decide. The maximum current is 100 mA. The gate threshold current for the Q4010L5 in quadrants I and III is 50 mA. That gives a margin of 2 times. The problem is that if you want to the triac to turn on near zero, the voltage is quite small, but if you try to turn on near the peak voltage, you will get a large current through the MOC3021. If your software in the microcontroller is wrong, you could blow the MOC3021.
However, the peak current allowed is 1 A. If you aim for that at 350 V, the peak with 240 V ac, then you will get around 50 mA at around 20 V, so that will happen quite near the zero.
To get that, R1 (or R2) needs to be around 400 Ohms.
Have a look at the circuit here:-
https://www.mouser.co.uk/datasheet/2/239/MOC302-1175440.pdf
The capacitor and the resistor between MT1 and G on the triac are both sensible precautions.