I tried to help myself understand this by deriving the following equation from the general equation for density: V=n*M/ρ, for the problem I posted, the number of moles decreases 2 times the molar mass increases two times, so the volume doesn't change, so this can be applied for liquids with same density.

For the gasses it is the same situation, only that here the density can't be same, because from the gas law: ρ=M*p/(R*T), when I put this in the previous equation I will get M^{2}, so the volume will drop two times. This is probably the correct reason.

EDIT: Mistake, I get the M neglected, so I am at the beginning again. This is really hard for me to understand, can someone explain it clearly, or at least post a link where this is explained (I mean the difference for the gasses).