Linux internet connection and partitions

How can Linux computer allocate a single internet connection with multiple machines? Can it be made a router? If so how can I do it? And when installing Linux, how many partitions needed to set it correctly? What is the minimum and maximum numbers of partitions can be made? Thank you.
