It's like a MOSFET you apply a sufficient voltage to the gate and it turns on. You can't turn it off whenever you want though. You can only turn on triacs...you can't turn them off via the gate. An external factor must turn off the triac. For AC, this happens when the AC crosses zero and no gate signal is present to "turn the triac back on".
But use a triac driver IC. It will isolate your PIC from the high voltage lines and steal a sufficient amount of voltage from the high voltage line to drive the triac since your PIC's is probably not enough voltage or current to directly drive the gate of the triac (though it may be, I don't know).
And because the gate can have two voltage polarities, and the voltage across the main terminal of the voltage can have 2 polarities, there are 4 possible signal combinations. 3 out of 4 combinations will turn the triac on, but one will not so if you are using a unipolar gate drive voltage you have to pick the one that works for the case where AC is positive and negative across the main terminals of the triac. See attached image.
Also, among the working combinations, some turn the triac on better than others. The best case is when the gate polarity matches the polarity of the AC across the triac's main terminals. But it's complicated to make a microcontroller (or anything DC really) produce a bipolar voltage cause you need more power supplies etc. But no worries. If you go this route just use a triac gate driver IC. It will steal a little voltage from the AC line (which always happens to be the polarity required by the gate for best performance). So no extra work or power supplies. Just a simple IC. It will also isolate your low voltage circuits from the high voltage line.