Hi,
You can use the filter like this.
my:field2 = "Active" and (my:field1 = "A" or my:field1 = "B")
Example:
count(/my:myFields/my:group1/my:group2[my:field2 = "Active" and (my:field1 = "A" or my:field1 = "B")])
Here the group2 is repeating section and field1, fied2 are fields in group2.