Gon_FREEKS:
The code that I wrote for that doesn't work and I need your help to do that.
You need to tell us what the program actually does and what you want it to do that is different.
Would it matter if you missed the very first occurrence of the double pulse when the engine starts?
I presume you are aware that you can only identify a double pulse after the two have happened.
Your diagram shows 3 single pulses between every double pulse - can that pattern be relied on? If so I would detect double pulse, then start counting single pulses, and then the first pulse after the 3rd pulse will be the first of the next pair of double pulses. Reset the count when every double pulse is detected.
If this was my project I would use a RISING interrupt to detect each pulse and I would measure the time using micros() for greater accuracy.
...R