You only have to hold the second buy 3 days if there are insufficient settled funds in your account to cover the purchase. IOW, let's say you sell the stock you held 6 months and receive $5K and have no other funds in the account. You can use that $5K to buy another stock the same day but must wait 3 days before you sell that stock because it takes 3 days for the unsettled funds you used for the purchase to clear.
OTOH, let's say you have $5K in settled funds in the account in addition to the stock you've held for 6 months and you sell the stock for $5K. You now have $5K of settled funds in the account plus $5K of unsettled funds you received from the sale. If you then buy another stock for $5K or less the same day as the first sale you can resell that stock again immediately because you bought it using the $5K of settled funds already in your account, however, if you buy a stock for more than $5K, you are using both settled and unsettled funds and must hold that position until the funds are cleared and the stock paid-in-full (3 days later).
The simplest way to think of it is any stock you are buying with unsettled funds (funds that result from a prior sale and that have not yet cleared in your account) cannot be sold until the funds you used to purchase it have settled and that stock is considered paid-in-full, which usually takes 3 days.
Newly