Is this legal? And should we use 2 by 8s?
What should the span between beams be when laying 2&quot;x 4&quot;s or 2&quot;x 8s&quot;?

If your question is only what should the floor joist spacing be then; if you go with 2&quot;x 8&quot; floor joist    16 &quot;  on center (OC) will be sufficient.
I would not use 2&quot;x 4&quot;s.
If you use 2&quot;x 6&quot;s then i would go 12&quot; OC.
If your question is how should i rebuild this then; I would rip it all out, Bolt rim joists to the concrete wall with anchor's and run the joist from wall to wall (left to right in the photo) hung on the rim joist with Simpson joist hangers and then re-do the plumbing.