You cannot use a simple Network Switch to connect two computers simultaneously to the internet - you need to use a Router.
This is because every computer connected to the internet must have a unique IP address, but the ISP only allocates one IP address. This means that only the first computer to connect will get an IP address and get online. When you use a Router, it [the router] gets the single IP address and, in turn, allocates addresses to the computers connected to it, using one of the address ranges reserved for Local Area Networks, most commonly 192.168.x.x addresses. The Router then "routes" the internet traffic to the appropriate computer in the Local Area Network.