Get more BJJ techniques in my Totally Awesome Journal.
The triangle is the second major attack I use from s-mount. Here is one way of getting it that works off the same grip as I use to take the armbar.
I am trapping the near arm for the armbar (hugging my hip, elbow to elbow), and Trog is defending like always. With my right hand, I grab his far wrist and shove it down and away from me.
As I push his arm down, I throw my right leg over the arm.
I bring my right leg towards his head, trying to get my calf on his neck and my foot behind his head.
I lean towards his far hip, posting on the mat for balance. I base on my right knee as I bring my leg deeper around his head and neck.
I triangle my legs and come back to center for a mounted triangle.
Now for some troubleshooting. An opponent who is wise to the triangle will often try to defend it by not letting the leg pass over their far arm.
Here we see me going for the triangle but Trog is holding his wrist and trying to keep his far arm inside so I can't get the triangle.