You're asking three different questions here:
- How does routing work when a computer is connected to more than one network?
- How does name resolution work in a scenario where multiple network connections are involved?
- Are there any guidelines/best practices one should follow when setting up a network like this?
As for the first question, the critical part of the setup has to do with the choice of "default gateway". In most networks, IP addresses are handed out automatically via DHCP, and along with then IP address, each client gets told which gateway to use. That's problematic when several networks are involved, because multiple "default" gateways simply doesn't work in most scenarios. (And it doesn't make sense anyway; how can there be more than one "default" of anything?)
When a host is told to use two "default" gateway, the TCP/IP standard dictates that traffic should be load balanced across both/all gateways. If one or more of those gateways perform Network Address Translation (which most do these days if they're connected to the Internet), the result will be slow/unstable/no Internet access. There is no way to configure the DHCP servers/scopes in such a way that one gateway will take precedence over the other. In general, multiple network connections should be avoided for all non-routers, unless all but one network has a gateway.
About name resolution: You mention the "hosts" file, which is an ancient way of providing name resolution in networks. Sure, it works, but you really should consider setting up a local DNS service, if at all possible.
But again, if you have multiple network connections that each provide different DNS server settings via DHCP, it's all going to be a big mess. You can indeed specify multiple DNS servers on a host, but the host will interpret that at "always use the first server unless it's completely unavailable, and only then proceed down the list". Unless you can redesign your network, the "hosts" file may actually be your best bet.
"Best practices" would be to separate the networks using a firewall/router instead of connecting each client to multiple networks. That would be the quickest and most efficient way to solve all your issues. In a corporate environment one would usually configure a VLAN for each network, and since switches supporting VLANs/802.1q are really cheap these days, that's what I'd recommend.