Yes I understand, but I've tried to redraw the first shape when dragging and it still got overlapped.I'm not sure how you redraw it exactly, but the way SFML works is, that you always clear the whole screen, then draw stuff to it and then display it.
I cant just clear the window ...You need to clear the window every frame. It is not optional, this is the way SFML works. The only solution to your problem is to clear the window every frame and redraw everything in the order you want it drawn.