Custom Filter Condition to accept only two values from a list at a time(Without Exclude)

How do I accept only two consecutive values in a checkbox filter list?

Hi @Emma_Vaze, can you provide more details on your use-case?