Fitting a homography using RANSAC is pretty straightforward. Being a iterative method, in a single iteration a random sample of four correspondences is selected from the given correspondence points and a homography H is then computed from those points.
The original points are then transformed using this homography and their distances to where those transforms should be is then computed and matching points can classified as inliers and non-matching points as outliers.
After a given number of iterations, the iteration which produced the largest number of inliers is then selected as the best estimation for H.
References: