The ordinary least squares, or OLS is a method for approximately determining the unknown parameters located in a linear regression model. This method is obtained by minimizing the total of squared vertical distances between the observed responses within the dataset and the responses predicted by the linear approximation. Through a simple formula, you can express the resulting estimator, especially the single regressor, located on the right-hand side of the linear regression model. Also it is your overall solution in minimizing the sum of the squares of errors in your equation.
The Maximum likelihood Estimation, or MLE, is a method used in estimating the parameters of a statistical model, and for fitting a statistical model to data. Using the maximum likelihood estimation, you can estimate the mean and variance of the height of your subjects. The MLE would set the mean and variance as parameters in determining the specific parametric values in a given model.
Also for more information about this subject please see links and attched file in this topics.
-What is the difference between OLS and MLE? - Quora
The methods of least squares and maximum likelihood are two different statistical procedures. The OLS is used to estimate the coefficients in a linear regression model by minimizing the sum of squares of the differences between fitted values and observed values regardless of the form of the distribution of the errors. Least squares produces best linear unbiased estimators of those coefficients. However, if the form of the distribution of the errors is known, the alternative of MLE can be used to estimate those coefficients. In other words, if you try to use MLE to estimate those parameters, then the form of the distribution of the random error needs to be assumed so that the likelihood function can be obtained. Of course, if the hypothesis testing and confidence interval construction are to be performed with OLS, then the form of the errors usually is assumed a normal distribution. That is why we have those t-test, chi-square test and F-test with OLS if the errors are normally distributed.