Burying more than one person in a single grave
When a grave becomes full, it is necessary to bury new bodies in new plots since it is impermissible to bury more than one individual in a single grave except when necessary.
Permissibility of burying more than one individual in a single grave
In the presence of a necessity such as limited burial plots, it is permissible to bury more than one individual in a single grave as was the case with the martyrs of the battle of Uhud.
Manner of burying more than one individual in a single grave
A barrier is to be made between individuals buried in the same grave even if they are of the same gender. When there is limited burial space, as mentioned in the question, you may construct multiple levels inside the same grave if possible. Alternatively, you can construct an arch made of bricks or stones over the body previously buried without having them touch the bodies. Then you are to heap earth over the arch and bury a new corpse over it.
Allah Almighty knows best.