I’ve read there https://www.raspberrypi.org/documentation/usage/gpio/ that we have 4 pins which can be used as analog, but other people say that we use only 2, so what’s the correct answer?
The Raspberry Pi has NO analogue GPIO. All the GPIO are digital only.
Perhaps you are being confused by some Arduino terminology. If a digital GPIO is used to generate PWM they often incorrectly refer to that GPIO as an analogue output.
If that’s the case you are probably referring to the Pi’s hardware PWM (output) capability. The Pi’s with the 40 pin header (and the compute modules) can provide hardware PWM on GPIO 12, 13, 18, 19. However there are only two PWM channels so GPIO 12/18 will have identical outputs as will GPIO 13/19.