Recommendations for a sensor that will count people

Welcome to the forum, Marle!

Maybe this previous post will provide you with some insights.

Some security cameras can count customers entering stores, looking into the direction of store security might be worth it. Other professional sensors try to count people in office rooms for space management.

Cheaper but not 100% accurate idea would be to have a photoelectric barrier at the door (better two to be able to distinguish between entering and leaving the room). Problem ist that you might miss people walking in / out beside or very close to each other.
Simple floor contacts could be an option as well.
An ESP, Arduino or a Rasperry PI is an option to connect to those sensors - you might even run OH on the same PI and interface with the binding for the GPIO-Pins.
Depends on time, money and accuracy…
Regards
Thomas