How can I connect this washing machine outlet to the drain?
No, no, no!

You need to install that tall open pipe. Washing machines do not work correctly without one, and the associated air-gap between the washer drain and the drain-pipe. You'll have a fun time siphoning your washer with the setup you propose.