Can you give me some advice how to make it so motor will be in the middle, but at the same time keep the functionality of the 2 axles on the sides? It can go further up if necessary.
Something like this would work. Since this is just an idea pictured assembly doesn't feature any bracing required for this solution to work properly. Another thing to mention - 8T gears doesn't like high load (both torque and rotational speed), so keep that in mind as well. Axle in the middle has been added just to show it is connecting 8T gear with 16T below.
To minimize wear on the 8T gears, consider replacing the with 24T gears (if they fit inside your model), like so: