He would be happier at a farm IF the people would treat him well. Under any circumstance, do not hand your dog over, before you check this farm out. It would not be right by the dog to know that this is a safe, loving place. If this is a farm, they might have open to the public days. You could visit your dog then. But remember, it wouldn't be YOUR dog anymore, and you wouldn't be able to treat him like that. He probably wouldn't treat you like that, either. it would probably be easier to not visit, in reality.
Yes, you will have sadness and a little regret. You were not able to give the dog what it needs, so that would be natural. However, you could move on knowing you did the best thing for the dog. A sheep dog would not be happy in your home, and you made him happy. That's what you should focus on, because doing the right thing is not always easy.
In the future, I encourage you to learn about dogs. Learn about their needs (walks every single day, for any dog you would get, even the smallest,) temperament, breed, health issues, etc. Get behavioral training and socialize them. I have a feeling if you knew about this breed, you would not have chosen it. This is not a tiny beach house candidate. This could be a valuable learning experience, and really help you pick the perfect pet next time. That way, you can enjoy your pet from day one, and you don't have to worry about their happiness! Having dogs is wonderful, but having the wrong dog can be very difficult.