The tomato plant is a herbaceous perennial in its native habitat, but it is usually grown as an annual in temperate climates. So I guess you could call it both a herb and a shrub.
A herb. Even when perennial, it doesn't have persistent woody stems with secondary thickening, so is definitely not a shrub.