Declaring bankruptcy is a step taken by companies to get protection from creditors. (They cannot seize collateral unilaterally, etc.) The company can still operate, within the legal framework, and with the obvious limitation that nobody wants to be owed money by the firm. Although equity often ends up worthless after all creditors have their claims settled, this is not always the case. As such, equity shares may not be worthless.
The question of the value of the equity is distinct from being listed on an exchange. This question cannot be easily answered since each exchange has its own requirements to be listed.
For example, the NYSE criteria are here: link to standards.
Note the phrasing: “The NYSE reserves the right...” to delist under various criteria. As such, there are no hard rules on what must happen.
For each company of interest, one would need to go to the exchange(s) where the shares are traded to see the rules.