There are three versions of the "Rub-a-Dub-Dub" nursery rhyme, but the most well-known version is, "Rub-a-dub-dub, Three men in a tub, And who do you think they be? The butcher, the baker, The candlestick-maker, turn 'em out, knaves all three.' This version comes from Halliwell's "Nursery Rhymes of England" which was first printed in 1846.
The first recorded version of the rhyme was in 1798, and it was slightly different than the others. Instead of three men in a tub it was three maids, and instead of being knaves, they had all gone to the fair. This version most closely resembles the Mother Goose version, which is, "Rub-a-dub-dub! Three men in a tub, And who do you think they were? The butcher, the baker, the candlestick maker, And all of them gone to the fair!"