The reason to configure the various hostnames to
/etc/hosts is to allow the local web browser (client) to know which IP address to connect to reach the respective hostname, nothing else.
If you configure the web server to bind each virtual host to a different 127.0.0.* IP address, then you must also use associate the hostnames with the respective IP addresses. Otherwise the client won't be able to connect to the right virtual host. This would be IP-based virtual hosting.
But the webserver won't need
/etc/hosts at all, since it will be able to look at the headers of the HTTP request and see which hostname was actually used in the request. Even using just one port and one IP address, it will be able to present different content according to the hostname used in the request, if configured to do so. This is known as name-based virtual hosting.
Both Apache and nginx will be able to handle either method; it's just a matter of deciding which one to use. The name-based method will require less IP addresses, which makes it the most widely-used one in public webservers, since static IP addresses are a limited resource.
/etc/hosts, the "all names in the same line" makes it unambiguous that the first listed name is the primary one and the rest are aliases - sort of similar to using the CNAME records in DNS. If a client does both a forward and a reverse lookup, e.g. for HTTPS certificate verification purposes, this format is the most likely to pass the reverse lookup check without causing security warnings.
If you use "multiple lines with the same IP address" in
/etc/hosts, and perform a reverse lookup, only the first line with the matching IP will be returned.
In Linux, the
nslookup command will often explicitly query DNS only. To test the complete hostname resolution process just like an application would do, you should use
getent hosts <hostname-or-IP-address>. With this command, you can verify the effect of different
/etc/hosts configurations for yourself.
In StackExchange, the standard process would be one question per question post. Based on the title and the majority of contents of your post, this question was about
/etc/hosts. If you need help on configuring your webserver, you should post another question for that, rather than attempt to stretch this one into an extended discussion.