Both Icahn and Soros think that Lyft is going to lose value in the 6 months after the IPO. But Icahn can't sell for 6 months. So he calls Soros, Soros creates a short position in the stock for the amount that he's going to buy from Icahn - he can do that cheap because the stock is going to be around $72 dollars for the first few days of trading. He then buys Icahn's shares for $60. So Icahn got out at a reasonable price and Soros now created a short position at ~$70 and covered it using Icahn's shares for ~$60 giving himself a $10 profit per share with practically no risk despite the fact that he can't sell the shares he's long for 6 months. Icahn couldn't hold the short position because he's contractually obligated not to short the stock.
The very important point is he agreed the short BEFORE he bought the stock, because the sale from Icahn prohibited him from buying a short position for 6 months. He created a flat position that Icahn was contractually prohibited from creating.