Not Closely Related at All
Rhinos and pigs belong to different orders within the class Mammalia.
Rhinos: Order Perissodactyla, which includes horses and tapirs. They have odd-toed feet and a digestive system for tough plant material.
Pigs: Order Artiodactyla, which includes cows, deer, hippos, and camels. They have even-toed feet and a more complex digestive system.
Both are herbivores, but they evolved plant-eating independently. Rhinos are more closely related to horses, while pigs are more closely related to hippos.