UK botanists generally put cannabis in its own family, Cannabaceae, rather than the mulberry family, Moraceae. The family has also been called Cannabiaceae, Cannabidaceae and Cannabinaceae. It is in the order Urticales, along with the elm, mulberry & fig, banyan and nettle (Urtica) families.
"Herb" means different things in different contexts. In cooking and medicinal terms, it means a plant with a use for flavouring or medicine.
However, in technical botanical terms, a herb is a plant without woody stems above ground, which dies back each season -- as opposed, for example, to shrubs, trees, lianas, dwarf-shrubs etc. Herbs may die back to bulbs, rhizomes or roots, or die altogether.
Therefore some cooking herbs are not botanical herbs -- for example, rosemary and thyme are shrubs and bay is a tree. On the other hand potato is botanically a herb.
Cannabis grows from seed each season, dying down afterwards -- therefore botanically it is an annual herb.
It is also (depending upon variety) a medicinal herb, a recreational herb, and of course a seed or fibre crop.
Occasionally it's a weed instead, as when I found it once unexpectedly growing on my compost heap from discarded bird-seed.
Personally I prefer the products of the closely-related hop.