I want to count orders for each month by incrementing each order and resetting them for the next month in a dynamic fashion, like this.

I tried COUNTIF function to count the range of MONTH but the out put is the count if all the range, Take a look at the Sheet.
>Solution :
As per your provided sheet try below formula-
=Arrayformula(IF(D2:D="",,COUNTIFS(D2:D, D2:D, ROW(D2:D), "<="&ROW(D2:D))))
Actually you do not need helping Month column. You can achieve your desired result directly using below formula.
=Arrayformula(IF(B2:B="",,COUNTIFS(Month(B2:B), Month(B2:B), ROW(B2:B), "<="&ROW(B2:B))))
