A little more detail is required, your question leaves some of the task undefined. I will give one possible answer:
If you need to count up/down events, counting UP with edges on one line, and DOWN with events on another line, the easiest way is to configure two counters, connect each of the two signals to the SOURCE pins of the two counters, configure both counters for "simple event counting", read the two values and subtract to obtain the net count.