The standard and documented practice (for example, https://wiki.openstreetmap.org/wiki/Key:covered and https://wiki.openstreetmap.org/wiki/Tag:tunnel%3Dbuilding_passage ) is to have shared nodes where ways pass buildings in this way.