To do so you can try this way.
di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Quote\Api\ShippingMethodManagementInterface">
<plugin name="change_shipping method" type="VendorName\ModuleName\Plugin\ShowFreeShipping"/>
</type>
</config>
ShowFreeShipping.php
<?php
namespace VendorName\ModuleName\Plugin;
class ShowFreeShipping
{
public function __construct(\Magento\Checkout\Model\Session $checkoutSession){
$this->checoutSession $checkoutSession;
}
public function afterEstimateByAddress(Magento\Quote\Api\ShippingMethodManagementInterfac $subject, $methods)
{
$quote = $this->checoutSession->getQuote();
$postCode = $quote->getShippingAddress()->getPostcode();
$totals = $quote->getTotals();
$subtotal = $totals['subtotal']['value'];
foreach($methods as $key => &$method)
{
if($method->getMethodCode() == 'freeshipping')
{
//set condition whenever you want to show freeshipping or not
if($sbutotal <= 1000)
unset($methods[$key]);
}
}
return $methods;
}
}
Please make sure that you have enabled freeshipping from admin. Let me know if you need further assistance.