Dancing with the stars: formation of the Fomalhaut triple system and its effect on the debris discs