According to EU legislation, citizens of any EU country are free to move to another EU country.
If they can not support themselves, they can stay for a maximum of 3 months while looking for work; Once this limit is reached, they are violating the law and the host country has the right to deport them.
In your case, this does not apply to you in both cases, you stay less than 3 months and you have a job. You can go and do your work from anywhere in the EU for 2 months without any problem. Stop reading here if that's all you're interested in knowing.
This 3 month limit would be a theoretical problem for you if you had to stay longer. It is within this 3-month limit that you can no longer legally remain under the British system, but that you would have to change to the French system, be responsible for French and other taxes.
However, in practice this does not usually apply, since the British in Spain are particularly infamous for remaining illegally in the British system while living in Spain.
Even outside the EU there are many people who work for a company based in a country and (illegally) perform their functions on the Internet from a country where they do not have permission to work. This technical illegality is rarely enforced and would not be a problem unless they publicly announce what they are doing. But even then, (there are many digital nomadic bloggers), I am not familiar with the case that someone gets into trouble for it.
Brexit is, of course, the great potential key in the works. In the worst case, if everything explodes and we end up leaving without any agreement … then, technically it is possible that he can be deported on March 31 as an illegal alien without legal status to be in France.
However, even in the worst case, this is not likely to happen. Traveling home immediately after the date would be complicated because the planes could not fly legally to the UK, but it is likely that people who arrived for brief visits before Brexit will be treated according to the old rules.
In addition, although this goes very much towards politics and opinion, I do not see that this worst case is not a situation of such a probable agreement. Either the agreement that is currently being discussed in the parliament will be signed, which effectively means that everything remains mostly as it is with respect to the British in Europe for at least the next two years. Or, the can is kicked on the road and the current British national saber rattle contest continues for a few more years, which will likely result in the whole thing being canceled.