As I understand it, if two units are in adjacent hexes and one is in open ground and the other is on the upper level of a building, then they are not considered to be adjacent (even though they are in adjacent hexes). Is this right?
Note also that you have to be ADJACENT to use PBF (point blank fire). Or within one level of or higher than your target. In your example the unit in open ground can only use PBF at a unit on ground or first level but the unit in the building can always use PBF from a higher level.