It's not about how "close" it
It's not about how "close" it is to the wheels, it's about whether it's "between" the wheels. And whether they are the "driven" wheels makes no difference either way.
For instance, a classic VW Beetle (or 911) has the engine VERY CLOSE to the (driven) rear wheels. However, it is still rear-engined, because the engine is "behind" the rear wheels, not "between" the front and rear wheels.