In my usage, Engine is generally something that consumes gasoline (sometimes Diesel) and generate rotational power and lots of exhaust gas and heat.
I almost always use the term motor for an electromechanical machine that turns electrical into mechanical power.
Like all words, there's ambiguity to it.