First, both players need to know their correct ip. If you're playing on LAN, open command line (cmd in Windows->Execute) and type ipconfig -all. Then note the ip belonging to your correct(!) LAN adapter. Sometimes people have more than one adapters listed there, for vpn, another ethernet card and so on. Be sure to have the right one or test out all if necessary.
For internet BotE games, easiest way to find out your correct ip is to go to
http://www.whatsmyip.org and note it down. One player makes host (i.e. start a game in start menu), the other clicks on "join game". Then the other player types in the ip from whatsmyip.org from the host player (you need to chat to give it to him or write him an email). Be sure that you stay connected to the internet (some people have set their router to disconnect after 3 minutes of no internet activity, that way your ip will be lost since you get a new one when reconnecting). If you got a firewall, make bote free there or for testing purposes disable all firewalls (including windows firewall) completely. If your router needs setup, then make bote pass through there too. You will find information about freeing programs in your router specific manual.
I haven't used hamachi myself but it should work just alike. If you are on LAN and not playing over the internet, bote offers a LAN games list where you should see each other in start menu.