His ... he ... he
These words refer to Leviathan.
he leaves a spreading trail in the mud as if he were a threshing sledge
Just as a threshing sledge goes over grain on a threshing floor and turns it to powder, so Leviathan's tail leaves a trail in the mud as he wags it when he walks.