depending on make of engine...... on a chevy v8 the left cylinderhead is more towards the front then the right one,thus there it starts with #1,they count the #'s jumping from left to right,so left head is #1,#3,#5 and #7,right #2,#4 etc...
ford has the right head more forward so they start counting there #1...and i believe they count down the right head 1,2,3,4 then jump to most back one on left head working back to the front 5,6,7,8... Chrysler same as ford but 5,6,7,8 is counted from front to back again.... im doing this out of my head,so the counting might be a bit off,but i will get corrected by ford and chrysler owners...

little 4 bangers mostly count from front of engine to flywheel 1,2,3,4....