How you set up the AirPort Express will depend on what "main" router you have....and what you want the Express to do.
Do you have another Apple router providing the wireless network? If yes, then the AirPort Express can connect wirelessly and "extend" the wireless range of the network.
If you don't have another Apple router, then you would normally connect the Express to your router using a wired Ethernet cable connection. The Express can be located anywhere that the Ethernet cable will reach....up to 300+ feet, or about 100 meters.
If you only want to use the Express for AirPlay, it will wirelessly connect to most wireless networks.
Bottom line here.....we need more information from you about what it is that you want the Express to do.....and what make and model of router that you might already have......in order to answer your question correctly.