This tutorial shows how to remap touchpad tapping, so you Ubuntu will use 2-finger tap on touchpad as middle click (or paste), and 3-finger tap as right-click action.
GNOME, the default desktop in Ubuntu, has switched to Wayland and is going to drop classic Xorg session, the old method to remap touchpad tap buttons does not work anymore. Here’s the new method to do the job in recent Ubuntu releases e.g., Ubuntu 24.04 and 25.04.