I can't seem to find any rules that makes it illegal for the runner of a triple jump to jump into the pit on their second jump. Is it illegal or is their distance simply measured from where they landed on their second jump? Is there any official rule that says they can't start their jump from inside the pit?
IAAF rules require that the takeoff line be placed not less than 13 metres from the nearer edge of the landing pit (for men's competition; in women's competition it is 11 metres).
Notwithstanding that the rules require a hop, a step and a jump in that order, so that making two jumps would be a failure trial for the athlete, and that the men's world record is a total of just over 18 metres, actually managing to make it to the pit from the second phase, the step, would be an accomplishment in itself that any athlete who could do it may as well just win the competition.