Got to Tools | Options | Source Control | Visual Studio Team Foundation Server
click on the Configure User Tools:
You can add separate overrides for 'Compare' and 'Merge' operations. Click on Add and select the operation you want to override. You'd need to type the path to the tool you use, and the exact arguments your tool expects. For example to use BeyondCompare, add the following Arguments " %1 %2 /title1=%6 /title2=%7":
To Merge with BeyondCompare use the Arguments "%1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9"
In a 2006 blog post MS employee James Manning surveyed the arguments as expected by various tools: WinDiff, DiffDoc, WinMerge, Beyond Compare, KDiff3, Araxis, Compare It!, SourceGear DiffMerge, TortoiseMerge and Visual SlickEdit. The post is a good starting point, but be sure to check the up to date documentation of your tool.
It is highly recommended not to use for merge tools that are incapable of 3-way merges (e.g., WinMerge 2.x).