I found a function that draws polygons, but I need it when drawing the second polygon, that it would always delete the previous polygon, since there must always be one polygon on my map
<!DOCTYPE html>
<html>
<head>
<title>Draw Features</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<script src="https://openlayers.org/en/v4.6.4/build/ol.js"></script>
</head>
<body>
<div id="map" class="map"></div>
<form class="form-inline">
<label>Geometry type </label>
<select id="type">
<option value="Box">Box</option>
<option value="None">None</option>
</select>
</form>
which contains all the html and javascript code http://jsfiddle.net/p_tsagkis/c4o4put8/