You are not hooked up to the drain properly. If you do not create a trap the water will drain back into the machine. The drain tube goes from the bottom of the machine up to the top and then back to the bottom. You need to run the drain tube up to a final drain or other trap. You can even create another mini trap by making a loop before running into the drain. Whatever you do just try to get the hose to go about as high as the highest point at the back of the machine, but not higher, as it will create a siphon and flood the machine.
Answers & Comments
You are not hooked up to the drain properly. If you do not create a trap the water will drain back into the machine. The drain tube goes from the bottom of the machine up to the top and then back to the bottom. You need to run the drain tube up to a final drain or other trap. You can even create another mini trap by making a loop before running into the drain. Whatever you do just try to get the hose to go about as high as the highest point at the back of the machine, but not higher, as it will create a siphon and flood the machine.
Are you using only HE detergent? Usually water can't drain well when the tub fills with suds. Use only small amount of HE detergent.
Check the pump/filter if this is blocked, it will cause the situation you describe.