A MacBook Pro with a plain M4 chip supports using two external displays at the same time as the built-in display.
MacBook Pro (14-inch, M4, 2024) - Tech Specs - Apple Support
This is an upgrade over MacBook Pros with plain M1, M2, and M3 chips. Those with plain M1 and M2 chips only supported one external display, period. Those with plain M3 chips could only support two displays if you closed their lids (and they initially did not ship with that feature).
If you want support for three external displays, you would need a 14" or 16" MacBook Pro with a Max chip.
MacBook Pro (14-inch, M4 Pro or M4 Max, 2024) - Tech Specs - Apple Support
MacBook Pro (16-inch, 2024) - Tech Specs - Apple Support
No MacBook Pro has hardware support that will let you "connect up to 8 external displays." Both the M3 Ultra chip version of the Mac Studio, and the M2 Ultra version of the desktop Mac Pro, can drive up to eight displays. These are very expensive, high-end, A/C-powered desktop computers for niche applications.