The US president was addressing a huge crowd at a homecoming event in County Mayo, ending his trip to Ireland.