I understand cryptonight uses keccak and aes. I don't understand what the tail-hash means though.
There is a diagram on page 6 and 7 here which labels the last (tail) hash as "Chosen hash".
Then, the 2 low-order bits of the first byte of the state are used to select a hash function: 0=BLAKE-256 [BLAKE], 1=Groestl-256 [GROESTL], 2=JH-256 [JH], and 3=Skein-256 [SKEIN]. The chosen hash function is then applied to the Keccak state, and the resulting hash is the output of CryptoNight.