We were pleasantly surprised that the back of the washing machine is indented, allowing for more space than you would think. We were very constrained to a small space. The lines come off the back, but are actually on top of the back of the washer. Our water lines are on the right side of the washer and the hoses connected without a problem.
I don't know the positioning of your dryer vent and water lines. but this fit well in an area where we had very limited space. stop by the store and take a look at the back of the machine and you will get a better sense. Not seeing your closet, there are no guarantees, but If any unit will fit, this is the one.