JavaScript (Node.js), 22 17 bytes
(x,y)=>y+x*7**y&7
Try it online! Port of my answer to Cayley Table of the Dihedral Group \$D_3\$ but golfed down using the suggestions on my Python answer. Uses the following mapping:
id | r1 | r2 | r3 | s0 | s1 | s2 | s3
----+----+----+----+----+----+----+----
0 | 2 | 4 | 6 | 1 | 3 | 5 | 7
Older versions of JavaScript can be supported in a number of ways for 22 bytes:
(x,y)=>(y&1?y-x:y+x)&7
(x,y)=>y-x*(y&1||-1)&7
(x,y)=>y+x*(y<<31|1)&7