Hi Rebecca,
You have truncated the important part of the sentence -
Tu avait pu leur dire au revoir avant qu'ils ne partent = You had been able to say goodbye to them before they left
The reason for the 'ne explétif' is because of avant que.
Here is the Kwiziq lesson explaining how to use it :
Avant que + ne explétif + Le Subjonctif = Before I do
Come back to us if you have further questions on this matter.