They were playing here while you were gone.
They have been playing here while you were gone.
Can you please tell me Which one is correct?
Both are fully grammatical. The first one is completely idiomatic.
The second one is possible, but I think less likely, because "while you were gone" sets the temporal frame. But it might be said if you have only just returned, so their playing here has continued to the present.