WHIRLPOOL 7MGHW9150PW0 will not drain has f2 and
I don't have access to those error code profiles at this time, but it appears its an over level condition on the water level switch circuit caused by a defective pressure switch or plugged connecting hose causing it to overfill, or you could have a leaking/defective inlet valve which will cause it to fill at all times sorta, or defective/clogged pump.
Or someone may have connected the drain hose of your unit directly to the sewer line without an air gap and somehow you are getting dirty"grey" water backing up into your washing machine.. ewwwwwwwwww!!
best of luck, and have fun,