It will be soil. Can it be done?
Of course you CAN grow more than one plant per container. You "can" grow 20 plants in one container. . .its just not an optimal way to grow, because you'll end up with more work and less yield than the same container with only one (or a few) plants.
The problem is that if you have two or more plants in the same container, then
a. Depending on the size of the pots and plants, they will potentially compete for root volume, and
b. More importantly, more than one plant next to one another may compete for light. What happens is that if any part of a plant gets shaded, it will try and "stretch" towards the light. If you have two plants crowding each other (or more than two) then they'll all try to stretch to outdo each other, and you end up with really tall spindly plants instead of short bushy ones, like you want.
If you have the ability to run these plants in different pots, then do so. I'm quite sure you'd be better off with three 1.5 gallon pots than one 3 gallon pot.
In terms of total yield, you might even be better off with just two plants in one pot rather than three. . .that depends on their size and configuration.
If you "must" run three plants in one 5 gallon pot, then do yourself a favor and make sure you space out each plant so that they're as far away from each other as practicable. Say, make an equilateral triangle, with each plant being maybe 2 inches from the bucket edges.
You'll also want to train the plants so that they don't overlap their leaves. If that happens its a killer, as that's when they'll really try to compete with one another. They can share the center a bit, but you really want to make sure each plant gets its own "corner", so that the bulk of each plant is separate from the other two.