What are defining as a layover? That can mean changing planes in a few minutes or hours, what I would consider "In Transit" or a "Transfer"; or it could mean leaving the airport or even spending the night.
But it appears, that even for transfer, you need to be able to show test results, taken no more than 48 hours before arrival, and fill out a Passenger locator form for Portugal. Italy will also have requirements.
Here is another source for information: https://www.iatatravelcentre.com/world.php You can also go to the website of the airport you will transit through, often they give information for covid requirements of transit passengers.
Generally, any stop can complicate things; a transfer in the UK has from time to time caused many problems. It is certainly simpler to fly direct, just depends if the added hassle is worth the ticket savings, TAP can offer some very low ticket prices.