The type of fan you choose will most likely be determined by available space and proximity to existing duct systems. Bathroom fans come in a few main types:
Ceiling-mounted fans are installed into the ceiling and vent to the outside through the roof or ducts. This is the most common type of bathroom fan and is best for removing hot, damp air as it rises. The exhaust is almost undetectable from the outside.
Wall-mounted fans are installed in exterior walls and pull air directly outside. These fans do not need ductwork, but might have a visible register.
Inline fans are installed in the ceiling or wall, but the motor sits between ducts, remotely pulling the air outside. Because the motor is not attached directly to the ceiling, this is a very quiet bathroom fan. These are ideal when there's not enough space in the ceiling.
Never vent an exhaust fan to the attic. This keeps moist air indoors, often in a place where mold can grow undetected. Always vent bathroom fans to the outside.