Yahoo did indeed have two opportunities to acquire Google. In 1998, Larry Page and Sergei Brin were willing to sell their startup — their "soon-to-be patented PageRank system," the core of Google — for $1 million to continue their studies at Stanford. Yahoo declined the purchase because it wanted users to spend "time on its own platform" rather than being sent to a relevant site.
In 2002, Yahoo entered negotiations to purchase Google for $1 billion. However, during the length of the negotiation, Google raised its valuation to $3 billion. Since search only made up 6% of Yahoo's income stream, Yahoo refused the offer.
In 2006, Mark Zuckerberg refused Yahoo's offer to purchase Facebook for $1 billion. However, reports allege that Facebook's "board of directors would have forced Zuckerberg to accept an offer of $1.1 billion, yet Yahoo executives would not agree to the increased bid." However, Zuckerberg did not want to sell since Facebook had not yet built all of its products — at the time, Facebook was about to launch its News Feed.
In 2008, Microsoft proposed acquiring Yahoo for $44.6 billion, at $31 per share, but Yahoo wanted more per share. Ultimately, in 2016, Verizon announced its acquisition of Yahoo for $4.83 billion, then sold Yahoo (and AOL together) for $5 billion in 2021.