Drugs selectively targeting CB2 hold promise for treating neurodegenerative disorders, inflammation, and pain while avoiding psychotropic side effects mediated by CB1. The mechanisms underlying CB2 activation and signaling are poorly understood but critical for drug design. Here we report the cryo-EM structure of the human CB2-Gi signaling complex bound to the agonist WIN 55,212-2. The 3D structure reveals the binding mode of WIN 55,212-2 and structural determinants for distinguishing CB2 agonists from antagonists, which are supported by a pair of rationally designed agonist and antagonist. Further structural analyses with computational docking results uncover the differences between CB2 and CB1 in receptor activation, ligand recognition, and Gi coupling. These findings are expected to facilitate rational structure-based discovery of drugs targeting the cannabinoid system.