I solved the problem.
I managed to make the phone appear on the computer. There must be something broken in the microusb port in the phone because sometimes when I connect the phone nothing will appear on dmesg (I use Linux), sometimes I get USB errors and after trying a few times I managed to make it work.
I updated the recovery through fastboot and then I was able to successfully install the new ROM from recovery and now everything works alright.
Once the replacement board I ordered arrives I'll try replacing that and see if that fixes the USB connection problems.
Thanks to everybody who helped.