There are really only three options for e-bike motor placement: either on the front wheel, the back wheel or the cranks.
Placing the motor at the cranks offers much better weight distribution, which makes the bike more stable — a key consideration for both road and mountain bikes.
Hub based motors, found in the rear wheel, are usually lighter, so you're more likely to find them on electric road bikes. Motors in the front wheel are a lot less common, but you may find them on some hybrid e-bikes and folders.