How can I remove certain elements in the layout, but only when the customer is not logged in? In Magento 1, there was a logged in handle, but is there an equivalent in Magento 2?
I think you are looking for the alternatives of
customer_logged_out layout handles which are available in M1. Unfortunately the answer is NO. We don't have such layout handles available in M2.
But you have two events for this. They are
customer_logout. You need to use these events to achieve the desired result.
If you need this behavior via layout updates, then the only option which comes to my mind is the conditional blocks. However this only allows system configuration settings and hence cannot rely on this.
So in short, the desired behavior is not possible via layout updates and hence you need to look for other work around such as this
More details are in this link