Need advise regarding drainage issue

Scenario – Two story townhome with laundry upstairs. There are two full baths (upstairs) and one half bath (downstairs). On two recent occasions, when the washing machine discharged the half bath commode flushed. The next week when the washing machine discharged the same commode overflowed! Any idea what the problem could be? Thanks for your help.