I want to get the home root path

First of all your ajax doing approach is wrong when WordPress offer us great way to do this. Read this one why you should’t use your current approach and then read https://codex.wordpress.org/AJAX_in_Plugins how you can do ajax with wp_ajax hook. It’s really simple and easy. using this hook you don’t need to call external file neither need to load wp-load.php

Anyway to include wp-load.php file just use ABSPATH like this

$rootPath = str_replace(ABSPATH,"",getcwd());

Then include

include( $rootPath . '/wp-load.php' );

Moral, For using ajax in WordPress used WordPress wp_ajax hook instead any others.