it's hard to know without the rest of the circuit
since the resistor and processor blow up without the motor,
it looks like you're applying 220 V to them
this may be a good start at understanding the triac
In this tutorial we will learn about the TRIAC, which is a bidirectional device meaning it can conduct in both the direction. Due to this property TRIAC is exclusively used where sinusoidal AC supply is involved.
and this
Learn how to put together your own toaster oven controller with a handful of inexpensive, through-hole parts. The emphasis is on safety, low price, and minimal modification of the toaster oven.
especially the section on
TRIAC Driver and Isolated Driver Circuit
replace oven with motor and triac-actived with P0.6
NOTE: you are working with lethal voltages - learn how to do that safely