Try this out. And I'll use an Instant Ocean bucket as the example, since that is what I have. The bucket is tapered top to bottom, measuring 10 inches on the bottom and 11 1/4 on the top. I'll split the difference and say the average diameter is 10 5/8 inches.
There are 231 cubic inches of water in a gallon, so five gallons would have (231 X 5 =) 1155 cubic inches.
To determine the area of a cylinder, the formula is A = r2 x h x π , where h = height and r = radius.
Our radius is half the diameter of 10 5/8 inches, so 5 5/16 (5.3125).
Using the formula A = r2 x h x π
and now solving for h,
h = A / (r2 x π)
Using our example:
h = 1155 / 88.81
h = 13.02
So with my Instant Ocean bucket, if I measure 13 inches up from inside the bucket, and mark with a Sharpie, that's exactly 5 gallons.
Hope this helps