How you ally with the CPU in Red Alert 2 depends on the game mode. In a Free-For-All (FFA), you can't form alliances. In standard Battle mode, select a soldier and press A, or use the "Allies" tab to propose an alliance.
In Team Battle mode, you need to get the CPU onto your team and join that team before the game starts. Setting this up in advance is the key to teaming up successfully.