Routers and Hubs are very different devices on how they work and what they work.
A network hub is a hardware device that works as a common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets. Hubs simply broadcast the packets it receives to all the ports it has.
A switch is similar device but intelligent compared to the hubs. Switches are called intelligent because they don't simply copy the packets to all the ports but it looks at the destination address in data packets and forwards that packet only to the relevant port.
Hubs and Switches are the network devices that connect LAN.
But Routers are of different kinds. Router connects different LANs not the different segments of a LAN. Routers look at the destination IP address in received data packets and then decides which among the available route is
The major difference between a hub and a router is that hub works in LAN only while routers are for WAN. Hubs are unintelligent while routers are very intelligent.