Is it better to leave a laptop plugged in while at 100% or unplug it and drain, charge at around 20% and wait until 80-100% then repeat?
If these are your only options, leave it plugged in. The discharge and recharge cycle will decrease the battery lifespan much faster.
However, some laptops have a clever trick to maximize your battery lifespan: they can be configured to limit the charge up to 60%, the percentage that minimizes lithium battery degradation due to just sitting idle. Doing this, your battery will not degrade as fast as sitting at 100% charge. So, if your computer has this option, turn it on whenever you are going to leave the laptop connected for a long time. I know that Lenovo laptops have this option in the Lenovo vantage app.
The two things that damage Lithium batteries are high temperatures and high voltages. So my first advice to prolong a laptop battery life span is to keep it as cool as possible, do not store it under direct sunlight and try to improve the thermal dissipation of your machine cleaning the coolers or lowering the CPU clock when using the machine to low demanding tasks.
The voltage is more tricky to manage. The peak charge voltage of lithium batteries is around 4.20V per cell, representing 100% charge. If you charge the cell up to a lower voltage, and logically a lower capacity, your battery will endure more charge cycles. Tests indicate that the optimal peak charge to preserve the battery life span is 3.92V per cell, and this represents around 60% of the total battery capacity.
One last note: The difference is NOT marginal, a Lithium battery that is only charged to 60% of its capacity is expected to last around 2400 to 4000 charge cycles. In comparison, the same battery charged to 100% of its capacity every time is expected to last only 300 to 500 cycles, a five fold difference. This data is a bit old, so newer lithium battery tech may have improved this numbers, but the detrimental effect of high voltage on Lithium batteries lifespan is still present on modern batteries.
Finally, that´s why many electric cars only charge the Lithium battery up to 90%, leaving to the user the decision to charge the battery up to 100% only when the extra range it provides is really needed and newer iPhones have an optimized charging algorithm that delays charging beyond 80% in certain situations.