2nd and 3rd pillar after leaving Switzerland

Hi Mirager,
I’m thinking of Greece or Cyprus with my Greek GF. If, hypothetically, one was to retire before the Swiss pensionable age and take a lump sum from one’s pension - any idea if that lump sum is taxed?
Sorry, probably to detailed a question, but perhaps you know?