A basic guide for determining the number of goldfish that can be kept in an aquarium is 20 gallons of water for the first fish and 10 extra gallons for any additional fish. So for example, if you wanted to keep two goldfish, you would need a 30 gallon aquarium.
Overcrowding or overstocking the aquarium will result in poor water quality, if the filtering system is unable to cope with the excess wastes being produced by the inhabitants in the tank and the health of the fish will suffer. It is hard to supply adequate oxygen to accomodate an overcrowded tank. Overcrowding is also very stressful for the goldfish, which in the long run will make them more susceptible to different diseases.
Goldfish will be healthier and happier if given plenty of room to move around and grow..