According to DIN 12831, it depends on the thermal conditions on the other side of the wall. In a semi-detached house, the exterior wall (i.e. the partition wall between the two units) on the ground floor and upper floor usually does not need to be recorded, since the neighbouring rooms are typically heated and thus thermally conditioned similarly. These wall areas are therefore excluded.
However, if the attic or basement of the neighbouring unit is unheated, then this wall must be recorded as an internal wall adjacent to an unheated space.