You need to make sure that in both computers port 22 is open (firewalls anywhere?) and that there is a network route from A to B. (not behind NAT or behind NAT and forwarded/DMZ)
Are you able to ping both computers from eachother? [answered: yes]
Do either computers' IP addres fall in one of the following ranges?: 192.168.xxx.xxx, 10.xxx.xxx.xxx or 169.xxx.xxx.xxx
If so, they are behind a router of some sort and you will need to make sure the router knows to forward requests to the right computer through NAT/port forwarding, or setting up the DMZ in the routers configuration to the receiving computers' internal IP address.
For example, My Macbook Pro is 10.0.0.1 and the router is 10.0.0.138. lets say my public IP is 188.8.131.52 (all are fictional but for the example this will do fine.)
I have setup my router (which is also my broadband modem) to forward every request to 10.0.0.1 by putting it into the routers configuration via the utility that came with it.
now when i try to connect to 184.108.40.206 the router is the first responder but it knows to forward the request to my Macbook Pro so in the end my Macbook Pro responds through the router back to the requesting party.
If you don't setup any kind of forwarding on your router, it is likely to deny any kind of request from the outside world, and even if it doesn't, it's not going to know where to send the request on the internal network. (these days there is pretty much always an internal network even if you only use one computer).
I think the issue is not so much in the firewall but more likely to be in your router settings, you need to make sure that the receiving end actually gets to handle the request.