Simply put, it works like this:
Iri al la domo means you travel some distance to the house, but you don't necessarily enter it. The journey to the house is the main point.
Iri en la domon means you go into the house, but you could have been standing right next to it before going inside. Entering the house is the main point.
For the one in the middle of the image you can use either, depending on whether it's more important that you went some distance in the direction of the house (al la domo) or that you went inside of the house (en la domon).