The correct time marker to use in the sentence is "while". The completed sentence is: Sam was dancing at the party while his friends were singing.
Translation:
Сэм танцевал на вечеринке, в то время как его друзья пели.