Ok, I think I misunderstood the example at first. So, were the rogue and the wizard both hidden behind the parapet at the start of their respective turns? If so, I would grant them both advantage on their attack rolls. Afterwards, the rogue could duck back behind the parapet and use a bonus action to try to hide again with Cunning Action, though I don’t think doing so would be the best use of their bonus action given that the enemies would know exactly where the rogue was hiding and could easily move to a position from which they could see the rogue (assuming such a position exists within range of their movement), therefore rendering the rogue no longer hidden from them. The wizard could also duck back behind the parapet on their turn, but lacking any ability to try to hide as a bonus action, and having already used their action to attack, the only benefit they would get from doing so is whatever cover the parapet provides. And, of course, having seen the wizard do so, the enemies could move to a position from which they have a clear view of the wizard on their turns, (provided such a position exists within range of their movement).