وَمَنْ خَرَجَ مُسَافِرًا، صَلَّى رَكْعَتَيْنِ إِذَا فَارَقَ بُيُوتَ الْمِصْرِ.
Translation: Whoever sets out on a journey prays two rak‘ahs after passing beyond the town’s houses.
Intending a trip or preparing to depart is not enough: the traveller must actually leave the settled built-up area.