The PS2 and XBOX versions have a 2 player co-op mode on one machine but neither has online multiplayer. If you have two controllers, you can do multiplayer drivebys and rampages. You can’t play missions. It’s not split screen, so you have to stay close to your opponent and only one player can be driving a vehicle at a time.
There is no official online play in any version of San Andreas but there are many unofficial multiplayer mods for the PC version. The majority of them are very buggy or never even got to the release stage but SA:MP and MTA:SA are worth a try.
MTA:SA – Multi Theft Auto: San Andreas
SA:MP – San Andreas: Multiplayer
Bounce-Multiplayer – 0.12 – Discontinued, no updates for over 10 years
gtaTournament SA – 0.3c – Cancelled – Dracoblue now runs an SA-MP server