If an enemy can’t see you, but knows you go behind a cover…

Phantasmal Killer: Where is it the illusion-fear?

Can a character move into a space occupied by their ally, make an attack and then move away?