If someone knows how the command works please write: if a player is banned the command block should give a redstone signal.
There's no command for this.
There's no command that determines whether a player is / has been banned. Whether a player dies etc. Can be determined from the stats. But there's no statistic that says whether you have been banned.