On inboard engines, the propeller sits on a shaft that connects it to the engine inside.
On stern drive engines, the propellers sit at the base of a "lower unit" which is the half of the engine with the shift gears and rudder. On a stern drive, this part is outside the boat with the propeller directly attached to it.
On outboard engines, the propellers are at the bottom of the engine and lower unit combined that hang off the back of the boat on the transom (rear wall of the boat).