Random guess off of the top of my head:
Code
INIT Section
DB_JailCount(1);
DB_JailCount(2);



KB Section

IF
CharacterSawCharacter(Guard, Player)
AND
CharacterTemplatesInTrigger("CharacterTemplate String", TRIGGER:JailTrigger, _Count)
AND
CharacterTemplatesInTrigger("SecondCharTemplate String", TRIGGER:JailTrigger, _Count2);
AND
SUM(_Count, _Count2, _PlayerCount)
AND
NOT DB_JailCount(_PlayerCount)
THEN
Stuff