External products in WooCommerce are instances of WC_Product_External
class. This class has public get_product_url()
method which you can use to receive external URL.
So you need to get (current) product and call that method to get URL. After it you can use that URL in your template to wrap an image or something else.
/**
* Your custom template
*/
global $product;
?>
<div>
...
<a href="https://wordpress.stackexchange.com/questions/128534/<?php echo esc_url( $product->get_product_url() ) ?>"><img ...></a>
...
</div>