I think you can say close enough to a cover, The cover will response if you are in or not base on the pin down animation. If it looks different then means you are inside the cover, and gain the protection benefit.
Are we talking about cover or concealment?
The first one protects from being shot, by reducing the chance of being hit.
In this case, some cover protects in an area (trench, bunker, house) while others protect in a line along it (wall, sandbags, fence)
In case of buidings and trenches, yuo simply put your men inside and they should be good.
As for the directional cover, stay close to it, but not necessarily right on top of it.
If your soldiers are fired at and they duck instead of going prone, that means they’re in cover.
Concealment are bushes, trees, rocks, smoke, destroyed vechicles and lots of other things. They break line of sight and prevent soldiers from seeing what’s behind them.
In this case, you might want ot put your men inside the object, because on some rare occasions, he might be able to see out from it, without being detected himself.
Mostly however, you want to keep the concealment between your men and the enemy when you’re closing the distance OR, you make sure your soldiers have clear line of sight if you want to engage at range.
Concealment is essential when fighting long range weapons and entrenched enemy. (such sa bunker MG)
A historical official military information film that would be more interesting for urbzz to better code the enemy but since this topic could use a kick and since that film is rather interesting I’ll place it here none the less.