Mask multiple objects

ok so I’m trying to dynamically mask 2 two objects with the same mask, but it isn’t working, it seems that only one object can belong to a mask, is there some way to work around this